diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-01-12 14:24:39 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-01-12 14:24:39 -0200 |
| commit | 62787f1b1f9bb745afbf28b04241c9020a74b7a2 (patch) | |
| tree | f659203faca4a14ff82ecfa9321f5b5f1b505c7d | |
| parent | dcb7bb514e1d1e3ee0f56b380cb1cbb45f52b304 (diff) | |
| download | lua-62787f1b1f9bb745afbf28b04241c9020a74b7a2.tar.gz lua-62787f1b1f9bb745afbf28b04241c9020a74b7a2.tar.bz2 lua-62787f1b1f9bb745afbf28b04241c9020a74b7a2.zip | |
`exp' is "reserved word" in Visual-C++ ;-)
| -rw-r--r-- | lparser.c | 20 |
1 files changed, 10 insertions, 10 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 1.52 1999/12/29 18:07:10 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.53 2000/01/10 17:34:38 roberto Exp roberto $ |
| 3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -114,7 +114,7 @@ typedef struct FuncState { | |||
| 114 | static void body (LexState *ls, int needself, int line); | 114 | static void body (LexState *ls, int needself, int line); |
| 115 | static void chunk (LexState *ls); | 115 | static void chunk (LexState *ls); |
| 116 | static void constructor (LexState *ls); | 116 | static void constructor (LexState *ls); |
| 117 | static void exp (LexState *ls, vardesc *v); | 117 | static void expr (LexState *ls, vardesc *v); |
| 118 | static void exp1 (LexState *ls); | 118 | static void exp1 (LexState *ls); |
| 119 | 119 | ||
| 120 | 120 | ||
| @@ -740,13 +740,13 @@ static int cond (LexState *ls) { | |||
| 740 | 740 | ||
| 741 | static void explist1 (LexState *ls, listdesc *d) { | 741 | static void explist1 (LexState *ls, listdesc *d) { |
| 742 | vardesc v; | 742 | vardesc v; |
| 743 | exp(ls, &v); | 743 | expr(ls, &v); |
| 744 | d->n = 1; | 744 | d->n = 1; |
| 745 | while (ls->token == ',') { | 745 | while (ls->token == ',') { |
| 746 | d->n++; | 746 | d->n++; |
| 747 | lua_pushvar(ls, &v); | 747 | lua_pushvar(ls, &v); |
| 748 | next(ls); | 748 | next(ls); |
| 749 | exp(ls, &v); | 749 | expr(ls, &v); |
| 750 | } | 750 | } |
| 751 | if (v.k == VEXP) | 751 | if (v.k == VEXP) |
| 752 | d->pc = v.info; | 752 | d->pc = v.info; |
| @@ -935,7 +935,7 @@ static void constructor_part (LexState *ls, constdesc *cd) { | |||
| 935 | 935 | ||
| 936 | case NAME: { | 936 | case NAME: { |
| 937 | vardesc v; | 937 | vardesc v; |
| 938 | exp(ls, &v); | 938 | expr(ls, &v); |
| 939 | if (ls->token == '=') { | 939 | if (ls->token == '=') { |
| 940 | switch (v.k) { | 940 | switch (v.k) { |
| 941 | case VGLOBAL: | 941 | case VGLOBAL: |
| @@ -1088,9 +1088,9 @@ static void simpleexp (LexState *ls, vardesc *v, stack_op *s) { | |||
| 1088 | body(ls, 0, ls->linenumber); | 1088 | body(ls, 0, ls->linenumber); |
| 1089 | break; | 1089 | break; |
| 1090 | 1090 | ||
| 1091 | case '(': /* simpleexp -> '(' exp ')' */ | 1091 | case '(': /* simpleexp -> '(' expr ')' */ |
| 1092 | next(ls); | 1092 | next(ls); |
| 1093 | exp(ls, v); | 1093 | expr(ls, v); |
| 1094 | check(ls, ')'); | 1094 | check(ls, ')'); |
| 1095 | return; | 1095 | return; |
| 1096 | 1096 | ||
| @@ -1140,15 +1140,15 @@ static void arith_exp (LexState *ls, vardesc *v) { | |||
| 1140 | 1140 | ||
| 1141 | static void exp1 (LexState *ls) { | 1141 | static void exp1 (LexState *ls) { |
| 1142 | vardesc v; | 1142 | vardesc v; |
| 1143 | exp(ls, &v); | 1143 | expr(ls, &v); |
| 1144 | lua_pushvar(ls, &v); | 1144 | lua_pushvar(ls, &v); |
| 1145 | if (is_in(ls->token, expfollow) < 0) | 1145 | if (is_in(ls->token, expfollow) < 0) |
| 1146 | luaX_error(ls, "malformed expression"); | 1146 | luaX_error(ls, "malformed expression"); |
| 1147 | } | 1147 | } |
| 1148 | 1148 | ||
| 1149 | 1149 | ||
| 1150 | static void exp (LexState *ls, vardesc *v) { | 1150 | static void expr (LexState *ls, vardesc *v) { |
| 1151 | /* exp -> arith_exp {(AND | OR) arith_exp} */ | 1151 | /* expr -> arith_exp {(AND | OR) arith_exp} */ |
| 1152 | arith_exp(ls, v); | 1152 | arith_exp(ls, v); |
| 1153 | while (ls->token == AND || ls->token == OR) { | 1153 | while (ls->token == AND || ls->token == OR) { |
| 1154 | OpCode op = (ls->token == AND) ? ONFJMP : ONTJMP; | 1154 | OpCode op = (ls->token == AND) ? ONFJMP : ONTJMP; |
