Changeset 245 for cpp/frams/vm


Ignore:
Timestamp:
05/31/14 21:32:02 (10 years ago)
Author:
Maciej Komosinski
Message:

When compiling FramScript?, add \n after each error message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/framscript.y

    r197 r245  
    140140trctx.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);
    141141#else
    142 trctx.err->printf("goto is not supported");return 1;
     142trctx.err->printf("goto is not supported\n");return 1;
    143143#endif
    144144 }
     
    223223$$.setInt(pos);
    224224if (trctx.functionstackpos!=999)
    225         {trctx.err->printf("functions cannot be nested");return 1;}
     225        {trctx.err->printf("functions cannot be nested\n");return 1;}
    226226}
    227227                            '(' paramlist ')'
     
    242242{
    243243if (!$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;}
    245245int level=$2.getInt();
    246246if (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;}
    248248if (!doBreak(level)) return 1;
    249249};
     
    253253{
    254254if (!$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;}
    256256int level=$2.getInt();
    257257if (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;}
    259259if (!doContinue(level)) return 1;
    260260};
     
    324324
    325325case_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;}
    327327int c=trctx.labelcounter++; $1.setInt(c);
    328328trctx.out->printf("if s1,!=,%s,:_skip_%d\n",litstr($2),c);
     
    959959                          if ($3.constant) trctx.out->printf("move %s,@%s\n",litstr($3),str($1));
    960960                          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;}
    962962                      }
    963963
     
    10101010                trstack.adjust(-1);
    10111011                }
    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;}
    10131013            }
    10141014
     
    12861286{
    12871287if (trstack.loops.size()<level)
    1288         {trctx.err->printf("invalid 'break'"); return 0;}
     1288        {trctx.err->printf("invalid 'break'\n"); return 0;}
    12891289LoopInfo* li=trstack.loops.getLoop(level-1);
    12901290if (li->location != trstack.currentPos())
     
    12971297{
    12981298if (trstack.loops.size()<level)
    1299         {trctx.err->printf("invalid 'continue'"); return 0;}
     1299        {trctx.err->printf("invalid 'continue'\n"); return 0;}
    13001300LoopInfo* li=trstack.loops.getLoop(level-1);
    13011301if (li->location != trstack.currentPos())
Note: See TracChangeset for help on using the changeset viewer.