diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-07-24 15:02:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-07-24 15:02:38 -0300 |
commit | e1a127245d3d977945819240a2df90ceb8ae516f (patch) | |
tree | 8be4a6f04d317bf1c92c40e2ea3fda7dde80b9c7 | |
parent | afb5ef72e1974ba6d0fc336637c71f3ee8fb03a2 (diff) | |
download | lua-e1a127245d3d977945819240a2df90ceb8ae516f.tar.gz lua-e1a127245d3d977945819240a2df90ceb8ae516f.tar.bz2 lua-e1a127245d3d977945819240a2df90ceb8ae516f.zip |
details ("luaX_token2str" doesn't need LexState)
-rw-r--r-- | llex.c | 4 | ||||
-rw-r--r-- | llex.h | 4 | ||||
-rw-r--r-- | lparser.c | 8 |
3 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.22 1998/06/19 18:47:06 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.23 1998/07/06 22:04:58 roberto Exp roberto $ |
3 | ** Lexical Analizer | 3 | ** Lexical Analizer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -59,7 +59,7 @@ void luaX_error (LexState *ls, char *s) { | |||
59 | } | 59 | } |
60 | 60 | ||
61 | 61 | ||
62 | void luaX_token2str (LexState *ls, int token, char *s) { | 62 | void luaX_token2str (int token, char *s) { |
63 | if (token < 255) { | 63 | if (token < 255) { |
64 | s[0] = token; | 64 | s[0] = token; |
65 | s[1] = 0; | 65 | s[1] = 0; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.h,v 1.8 1998/05/27 13:03:40 roberto Exp roberto $ | 2 | ** $Id: llex.h,v 1.9 1998/06/19 16:14:09 roberto Exp roberto $ |
3 | ** Lexical Analizer | 3 | ** Lexical Analizer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -56,7 +56,7 @@ void luaX_setinput (LexState *LS, ZIO *z); | |||
56 | int luaX_lex (LexState *LS); | 56 | int luaX_lex (LexState *LS); |
57 | void luaX_syntaxerror (LexState *ls, char *s, char *token); | 57 | void luaX_syntaxerror (LexState *ls, char *s, char *token); |
58 | void luaX_error (LexState *ls, char *s); | 58 | void luaX_error (LexState *ls, char *s); |
59 | void luaX_token2str (LexState *ls, int token, char *s); | 59 | void luaX_token2str (int token, char *s); |
60 | 60 | ||
61 | 61 | ||
62 | #endif | 62 | #endif |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.2 1998/06/24 14:48:15 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.3 1998/07/06 22:07:51 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 | */ |
@@ -580,7 +580,7 @@ static void next (LexState *ls) { | |||
580 | 580 | ||
581 | static void error_expected (LexState *ls, int token) { | 581 | static void error_expected (LexState *ls, int token) { |
582 | char buff[100], t[TOKEN_LEN]; | 582 | char buff[100], t[TOKEN_LEN]; |
583 | luaX_token2str(ls, token, t); | 583 | luaX_token2str(token, t); |
584 | sprintf(buff, "`%s' expected", t); | 584 | sprintf(buff, "`%s' expected", t); |
585 | luaX_error(ls, buff); | 585 | luaX_error(ls, buff); |
586 | } | 586 | } |
@@ -591,8 +591,8 @@ static void error_unmatched (LexState *ls, int what, int who, int where) { | |||
591 | else { | 591 | else { |
592 | char buff[100]; | 592 | char buff[100]; |
593 | char t_what[TOKEN_LEN], t_who[TOKEN_LEN]; | 593 | char t_what[TOKEN_LEN], t_who[TOKEN_LEN]; |
594 | luaX_token2str(ls, what, t_what); | 594 | luaX_token2str(what, t_what); |
595 | luaX_token2str(ls, who, t_who); | 595 | luaX_token2str(who, t_who); |
596 | sprintf(buff, "`%s' expected (to close `%s' at line %d)", | 596 | sprintf(buff, "`%s' expected (to close `%s' at line %d)", |
597 | t_what, t_who, where); | 597 | t_what, t_who, where); |
598 | luaX_error(ls, buff); | 598 | luaX_error(ls, buff); |