[teu] / trunk / tertius / src / lua / src / llex.c Repository:
ViewVC logotype

Diff of /trunk/tertius/src/lua/src/llex.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 40, Wed Nov 7 22:02:52 2007 UTC revision 243, Thu Apr 22 02:46:50 2010 UTC
# Line 39  Line 39 
39      "end", "false", "for", "function", "if",      "end", "false", "for", "function", "if",
40      "in", "local", "nil", "not", "or", "repeat",      "in", "local", "nil", "not", "or", "repeat",
41      "return", "then", "true", "until", "while",      "return", "then", "true", "until", "while",
42        "..=", "+=", "-=", "*=", "/=", "^=", "%=",
43      "..", "...", "==", ">=", "<=", "~=",      "..", "...", "==", ">=", "<=", "~=",
44      "<number>", "<name>", "<string>", "<eof>",      "<number>", "<name>", "<string>", "<eof>",
45      NULL      NULL
# Line 340  Line 341 
341        }        }
342        case '-': {        case '-': {
343          next(ls);          next(ls);
344                    if (ls->current == '=') {
345              next(ls);
346                      return TK_SUBASSIGN;
347                    }
348          if (ls->current != '-') return '-';          if (ls->current != '-') return '-';
349          /* else is a comment */          /* else is a comment */
350          next(ls);          next(ls);
# Line 371  Line 376 
376          if (ls->current != '=') return '=';          if (ls->current != '=') return '=';
377          else { next(ls); return TK_EQ; }          else { next(ls); return TK_EQ; }
378        }        }
379          case '+': {
380            next(ls);
381            if (ls->current != '=') return '+';
382            else { next(ls); return TK_ADDASSIGN; }
383          }
384          case '*': {
385            next(ls);
386            if (ls->current != '=') return '*';
387            else { next(ls); return TK_MULASSIGN; }
388          }
389          case '/': {
390            next(ls);
391            if (ls->current != '=') return '/';
392            else { next(ls); return TK_DIVASSIGN; }
393          }
394          case '^': {
395            next(ls);
396            if (ls->current != '=') return '^';
397            else { next(ls); return TK_POWASSIGN; }
398          }
399          case '%': {
400            next(ls);
401            if (ls->current != '=') return '%';
402            else { next(ls); return TK_MODASSIGN; }
403          }
404        case '<': {        case '<': {
405          next(ls);          next(ls);
406          if (ls->current != '=') return '<';          if (ls->current != '=') return '<';
# Line 394  Line 424 
424        case '.': {        case '.': {
425          save_and_next(ls);          save_and_next(ls);
426          if (check_next(ls, ".")) {          if (check_next(ls, ".")) {
427                      if (check_next(ls, "="))
428                        return TK_CONCATASSIGN;
429            if (check_next(ls, "."))            if (check_next(ls, "."))
430              return TK_DOTS;   /* ... */              return TK_DOTS;   /* ... */
431            else return TK_CONCAT;   /* .. */            else
432                            return TK_CONCAT;   /* .. */
433          }          }
434          else if (!isdigit(ls->current)) return '.';          else if (!isdigit(ls->current)) return '.';
435          else {          else {

Legend:
Removed from v.40  
changed lines
  Added in v.243

svnmaster@icculus.org
ViewVC Help
Powered by ViewVC 1.0.4