|
@@ -37,10 +37,10 @@ static Operation sReadOperation(Script* sc) {
|
|
unsigned char c;
|
|
unsigned char c;
|
|
if(sRead(sc, &c, 1)) {
|
|
if(sRead(sc, &c, 1)) {
|
|
return OP_NOTHING;
|
|
return OP_NOTHING;
|
|
- } else if(sRead(sc, &sc->line, 2)) {
|
|
|
|
|
|
+ } /*else if(sRead(sc, &sc->line, 2)) {
|
|
sError(sc, "operation without line near line %d", sc->line);
|
|
sError(sc, "operation without line near line %d", sc->line);
|
|
return OP_NOTHING;
|
|
return OP_NOTHING;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
return c;
|
|
return c;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -152,6 +152,12 @@ static void sPrint(Script* sc) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void sLine(Script* sc) {
|
|
|
|
+ if(sRead(sc, &sc->line, 2)) {
|
|
|
|
+ sError(sc, "line operation without a line near line %d", sc->line);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static void sConsumeInstruction(Script* sc) {
|
|
static void sConsumeInstruction(Script* sc) {
|
|
switch(sReadOperation(sc)) {
|
|
switch(sReadOperation(sc)) {
|
|
case OP_NOTHING: break;
|
|
case OP_NOTHING: break;
|
|
@@ -163,6 +169,7 @@ static void sConsumeInstruction(Script* sc) {
|
|
case OP_ADD: sIntBinary(sc, sIntAdd, sFloatAdd); break;
|
|
case OP_ADD: sIntBinary(sc, sIntAdd, sFloatAdd); break;
|
|
case OP_MUL: sIntBinary(sc, sIntMul, sFloatMul); break;
|
|
case OP_MUL: sIntBinary(sc, sIntMul, sFloatMul); break;
|
|
case OP_PRINT: sPrint(sc); break;
|
|
case OP_PRINT: sPrint(sc); break;
|
|
|
|
+ case OP_LINE: sLine(sc); break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|