Changeset 245 for cpp/frams/vm
- Timestamp:
- 05/31/14 21:32:02 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/framscript.y
r197 r245 140 140 trctx.out->printf("jump :%s\n",str($2)); FMprintf("FramScriptCompiler","translate",FMLV_WARN,"goto is not recommended (%s line %d)",(const char*)trctx.srcname,trctx.line); 141 141 #else 142 trctx.err->printf("goto is not supported ");return 1;142 trctx.err->printf("goto is not supported\n");return 1; 143 143 #endif 144 144 } … … 223 223 $$.setInt(pos); 224 224 if (trctx.functionstackpos!=999) 225 {trctx.err->printf("functions cannot be nested ");return 1;}225 {trctx.err->printf("functions cannot be nested\n");return 1;} 226 226 } 227 227 '(' paramlist ')' … … 242 242 { 243 243 if (!$2.constant) 244 {trctx.err->printf("break level must be a constant expression ");return 1;}244 {trctx.err->printf("break level must be a constant expression\n");return 1;} 245 245 int level=$2.getInt(); 246 246 if (level<1) 247 {trctx.err->printf("break level must be a positive integer ");return 1;}247 {trctx.err->printf("break level must be a positive integer\n");return 1;} 248 248 if (!doBreak(level)) return 1; 249 249 }; … … 253 253 { 254 254 if (!$2.constant) 255 {trctx.err->printf("continue level must be a constant expression ");return 1;}255 {trctx.err->printf("continue level must be a constant expression\n");return 1;} 256 256 int level=$2.getInt(); 257 257 if (level<1) 258 {trctx.err->printf("continue level must be a positive integer ");return 1;}258 {trctx.err->printf("continue level must be a positive integer\n");return 1;} 259 259 if (!doContinue(level)) return 1; 260 260 }; … … 324 324 325 325 case_label: CASE expr ':' 326 {if (!$2.constant) {trctx.err->printf("case label must be a constant expression ");return 1;}326 {if (!$2.constant) {trctx.err->printf("case label must be a constant expression\n");return 1;} 327 327 int c=trctx.labelcounter++; $1.setInt(c); 328 328 trctx.out->printf("if s1,!=,%s,:_skip_%d\n",litstr($2),c); … … 959 959 if ($3.constant) trctx.out->printf("move %s,@%s\n",litstr($3),str($1)); 960 960 else trctx.out->printf("move s0,@%s\n",str($1));} 961 else {trctx.err->printf("undefined variable: %s\n",str($1)); return 1;}961 else {trctx.err->printf("undefined variable: '%s'\n",str($1)); return 1;} 962 962 } 963 963 … … 1010 1010 trstack.adjust(-1); 1011 1011 } 1012 else {trctx.err->printf("undefined variable: %s\n",str($1)); return 1;}1012 else {trctx.err->printf("undefined variable: '%s'\n",str($1)); return 1;} 1013 1013 } 1014 1014 … … 1286 1286 { 1287 1287 if (trstack.loops.size()<level) 1288 {trctx.err->printf("invalid 'break' "); return 0;}1288 {trctx.err->printf("invalid 'break'\n"); return 0;} 1289 1289 LoopInfo* li=trstack.loops.getLoop(level-1); 1290 1290 if (li->location != trstack.currentPos()) … … 1297 1297 { 1298 1298 if (trstack.loops.size()<level) 1299 {trctx.err->printf("invalid 'continue' "); return 0;}1299 {trctx.err->printf("invalid 'continue'\n"); return 0;} 1300 1300 LoopInfo* li=trstack.loops.getLoop(level-1); 1301 1301 if (li->location != trstack.currentPos())
Note: See TracChangeset
for help on using the changeset viewer.