Ignore:
Timestamp:
02/28/15 03:42:40 (9 years ago)
Author:
Maciej Komosinski
Message:
  • use source/code mapping for line number and file information in vm error messages
  • mandatory parentheses in typeof()
  • int() float() string() added
  • typeof() returns plain names of core types instead of numeric constants
short-circuit evaluation of && and
  • fixed switch/case fall through (previously each case not ending with break jumped to default: (when present))
  • case labels do not have to be constant
File:
1 edited

Legend:

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

    r224 r332  
    3333\"\"\"             {trctx.tmp=""; trctx.multilimit='\"'; BEGIN multiline;}
    3434"'''"              {trctx.tmp=""; trctx.multilimit='\''; BEGIN multiline;}
    35 "@line "[0-9]+\n   {trctx.line=atol(yytext+6);}
    36 "@file "[^\n\t\r]+\n {trctx.srcname=SString(yytext+6,yyleng-7);}
     35"@line "[0-9]+\n   {trctx.line=atol(yytext+6);trctx.linechanged=true;}
     36"@file "[^\n\t\r]+\n {trctx.srcname=SString(yytext+6,yyleng-7);trctx.namechanged=true;}
    3737
    3838[a-zA-Z_][a-zA-Z0-9_]* { int t=lookupToken(yytext);
     
    6565">>"                return RSHIFT;
    6666
    67 <INITIAL,asmcode,asmcode2>\/\/.*\n         {trctx.line++;} // komentarz jednoliniowy
     67<INITIAL,asmcode,asmcode2>\/\/.*\n         {trctx.line++;trctx.linechanged=true;} // komentarz jednoliniowy
    6868<INITIAL,asmcode,asmcode2>\/\/[^\n]*       ;               // komentarz ale nie ma potem \n
    6969
    7070<INITIAL>\/\*       BEGIN comment;
    71 <comment>\n         {trctx.line++;}
     71<comment>\n         {trctx.line++;trctx.linechanged=true;}
    7272<comment>\*\/       BEGIN 0;
    7373<comment>.          ;
     
    8585                       trctx.tmp+=SString(yytext,yyleng);
    8686                    }
    87 <multiline>\n       {trctx.line++; trctx.tmp+="\n";}
     87<multiline>\n       {trctx.line++; trctx.linechanged=true; trctx.tmp+="\n";}
    8888[ \t\r\f]           ;
    89 \n                  {trctx.line++;}
     89\n                  {trctx.line++; trctx.linechanged=true;}
    9090.                   return yytext[0];
    9191
     
    9494                    char *t=yytext;
    9595                    while(t=strchr(t+1,'\n')) trctx.line++;
     96                    trctx.linechanged=true;
    9697                    return ASM;
    9798                    }
    9899<asmcode>.*\n {
    99100              char *t=yytext;
    100               trctx.line++;
     101              trctx.line++; trctx.linechanged=true;
    101102              while ((*t==' ')||(*t=='\t')) t++;
    102103              if (*t=='}') {yyless((t-yytext)+1); BEGIN 0; return '}';}
Note: See TracChangeset for help on using the changeset viewer.