diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-08-16 17:52:00 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-08-16 17:52:00 -0300 |
| commit | c787dccd9b5c3e55547a2c4bb598c0276de65034 (patch) | |
| tree | c4cdf2f7319fee48e048472a2044119f541e8da2 /llex.c | |
| parent | b44e35b773bcaa9891d80a117392911ab5f656e5 (diff) | |
| download | lua-c787dccd9b5c3e55547a2c4bb598c0276de65034.tar.gz lua-c787dccd9b5c3e55547a2c4bb598c0276de65034.tar.bz2 lua-c787dccd9b5c3e55547a2c4bb598c0276de65034.zip | |
"const" !!!
Diffstat (limited to 'llex.c')
| -rw-r--r-- | llex.c | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 1.36 1999/06/17 17:04:03 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.37 1999/07/22 19:29:42 roberto Exp roberto $ |
| 3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -28,8 +28,8 @@ | |||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | /* ORDER RESERVED */ | 30 | /* ORDER RESERVED */ |
| 31 | static char *reserved [] = {"and", "do", "else", "elseif", "end", "function", | 31 | static const char *const reserved [] = {"and", "do", "else", "elseif", "end", |
| 32 | "if", "local", "nil", "not", "or", "repeat", "return", "then", | 32 | "function", "if", "local", "nil", "not", "or", "repeat", "return", "then", |
| 33 | "until", "while"}; | 33 | "until", "while"}; |
| 34 | 34 | ||
| 35 | 35 | ||
| @@ -44,7 +44,7 @@ void luaX_init (void) { | |||
| 44 | 44 | ||
| 45 | #define MAXSRC 80 | 45 | #define MAXSRC 80 |
| 46 | 46 | ||
| 47 | void luaX_syntaxerror (LexState *ls, char *s, char *token) { | 47 | void luaX_syntaxerror (LexState *ls, const char *s, const char *token) { |
| 48 | char buff[MAXSRC]; | 48 | char buff[MAXSRC]; |
| 49 | luaL_chunkid(buff, zname(ls->lex_z), sizeof(buff)); | 49 | luaL_chunkid(buff, zname(ls->lex_z), sizeof(buff)); |
| 50 | if (token[0] == '\0') | 50 | if (token[0] == '\0') |
| @@ -54,7 +54,7 @@ void luaX_syntaxerror (LexState *ls, char *s, char *token) { | |||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | void luaX_error (LexState *ls, char *s) { | 57 | void luaX_error (LexState *ls, const char *s) { |
| 58 | save('\0'); | 58 | save('\0'); |
| 59 | luaX_syntaxerror(ls, s, luaL_buffer()); | 59 | luaX_syntaxerror(ls, s, luaL_buffer()); |
| 60 | } | 60 | } |
| @@ -117,8 +117,8 @@ static void skipspace (LexState *LS) { | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | 119 | ||
| 120 | static int checkcond (LexState *LS, char *buff) { | 120 | static int checkcond (LexState *LS, const char *buff) { |
| 121 | static char *opts[] = {"nil", "1", NULL}; | 121 | static const char *const opts[] = {"nil", "1", NULL}; |
| 122 | int i = luaL_findstring(buff, opts); | 122 | int i = luaL_findstring(buff, opts); |
| 123 | if (i >= 0) return i; | 123 | if (i >= 0) return i; |
| 124 | else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') | 124 | else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') |
| @@ -160,7 +160,7 @@ static void ifskip (LexState *LS) { | |||
| 160 | 160 | ||
| 161 | 161 | ||
| 162 | static void inclinenumber (LexState *LS) { | 162 | static void inclinenumber (LexState *LS) { |
| 163 | static char *pragmas [] = | 163 | static const char *const pragmas [] = |
| 164 | {"debug", "nodebug", "endinput", "end", "ifnot", "if", "else", NULL}; | 164 | {"debug", "nodebug", "endinput", "end", "ifnot", "if", "else", NULL}; |
| 165 | next(LS); /* skip '\n' */ | 165 | next(LS); /* skip '\n' */ |
| 166 | ++LS->linenumber; | 166 | ++LS->linenumber; |
