aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-05-17 16:49:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-05-17 16:49:15 -0300
commit67578ec51f1a3ec2c967f15d370067caf9e0b87b (patch)
treed77b292ddec33d7e6987bae808fa1db250ebd830 /lparser.c
parentc2bb9abceceef125554595e23b7cc18ad3555c7c (diff)
downloadlua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.tar.gz
lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.tar.bz2
lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.zip
several small details
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lparser.c b/lparser.c
index 3c7ddd6c..8bcffc04 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 2.25 2005/05/05 20:47:02 roberto Exp roberto $ 2** $Id: lparser.c,v 2.26 2005/05/16 21:19:00 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -82,7 +82,7 @@ static void anchor_token (LexState *ls) {
82 82
83static void error_expected (LexState *ls, int token) { 83static void error_expected (LexState *ls, int token) {
84 luaX_syntaxerror(ls, 84 luaX_syntaxerror(ls,
85 luaO_pushfstring(ls->L, LUA_SM " expected", luaX_token2str(ls, token))); 85 luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token)));
86} 86}
87 87
88 88
@@ -125,7 +125,7 @@ static void check_match (LexState *ls, int what, int who, int where) {
125 error_expected(ls, what); 125 error_expected(ls, what);
126 else { 126 else {
127 luaX_syntaxerror(ls, luaO_pushfstring(ls->L, 127 luaX_syntaxerror(ls, luaO_pushfstring(ls->L,
128 LUA_SM " expected (to close " LUA_SM " at line %d)", 128 LUA_QS " expected (to close " LUA_QS " at line %d)",
129 luaX_token2str(ls, what), luaX_token2str(ls, who), where)); 129 luaX_token2str(ls, what), luaX_token2str(ls, who), where));
130 } 130 }
131 } 131 }
@@ -577,7 +577,7 @@ static void parlist (LexState *ls) {
577 f->is_vararg = 1; 577 f->is_vararg = 1;
578 break; 578 break;
579 } 579 }
580 default: luaX_syntaxerror(ls, "<name> or '...' expected"); 580 default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected");
581 } 581 }
582 } while (!f->is_vararg && testnext(ls, ',')); 582 } while (!f->is_vararg && testnext(ls, ','));
583 } 583 }
@@ -765,7 +765,7 @@ static void simpleexp (LexState *ls, expdesc *v) {
765 case TK_DOTS: { /* vararg */ 765 case TK_DOTS: { /* vararg */
766 FuncState *fs = ls->fs; 766 FuncState *fs = ls->fs;
767 check_condition(ls, fs->f->is_vararg, 767 check_condition(ls, fs->f->is_vararg,
768 "cannot use '...' outside a vararg function"); 768 "cannot use " LUA_QL("...") " outside a vararg function");
769 fs->f->is_vararg = NEWSTYLEVARARG; 769 fs->f->is_vararg = NEWSTYLEVARARG;
770 init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); 770 init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0));
771 break; 771 break;
@@ -1017,7 +1017,7 @@ static void whilestat (LexState *ls, int line) {
1017 fs->jpc = NO_JUMP; 1017 fs->jpc = NO_JUMP;
1018 sizeexp = fs->pc - expinit; /* size of expression code */ 1018 sizeexp = fs->pc - expinit; /* size of expression code */
1019 if (sizeexp > LUAI_MAXEXPWHILE) 1019 if (sizeexp > LUAI_MAXEXPWHILE)
1020 luaX_syntaxerror(ls, "'while' condition too complex"); 1020 luaX_syntaxerror(ls, LUA_QL("while") " condition too complex");
1021 for (i = 0; i < sizeexp; i++) /* save `exp' code */ 1021 for (i = 0; i < sizeexp; i++) /* save `exp' code */
1022 codeexp[i] = fs->f->code[expinit + i]; 1022 codeexp[i] = fs->f->code[expinit + i];
1023 fs->pc = expinit; /* remove `exp' code */ 1023 fs->pc = expinit; /* remove `exp' code */
@@ -1141,7 +1141,7 @@ static void forstat (LexState *ls, int line) {
1141 switch (ls->t.token) { 1141 switch (ls->t.token) {
1142 case '=': fornum(ls, varname, line); break; 1142 case '=': fornum(ls, varname, line); break;
1143 case ',': case TK_IN: forlist(ls, varname); break; 1143 case ',': case TK_IN: forlist(ls, varname); break;
1144 default: luaX_syntaxerror(ls, "'=' or 'in' expected"); 1144 default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected");
1145 } 1145 }
1146 check_match(ls, TK_END, TK_FOR, line); 1146 check_match(ls, TK_END, TK_FOR, line);
1147 leaveblock(fs); /* loop scope (`break' jumps to this point) */ 1147 leaveblock(fs); /* loop scope (`break' jumps to this point) */