aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-08-16 17:52:00 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-08-16 17:52:00 -0300
commitc787dccd9b5c3e55547a2c4bb598c0276de65034 (patch)
treec4cdf2f7319fee48e048472a2044119f541e8da2 /llex.c
parentb44e35b773bcaa9891d80a117392911ab5f656e5 (diff)
downloadlua-c787dccd9b5c3e55547a2c4bb598c0276de65034.tar.gz
lua-c787dccd9b5c3e55547a2c4bb598c0276de65034.tar.bz2
lua-c787dccd9b5c3e55547a2c4bb598c0276de65034.zip
"const" !!!
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/llex.c b/llex.c
index 74aa7d3a..63404c3d 100644
--- a/llex.c
+++ b/llex.c
@@ -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 */
31static char *reserved [] = {"and", "do", "else", "elseif", "end", "function", 31static 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
47void luaX_syntaxerror (LexState *ls, char *s, char *token) { 47void 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
57void luaX_error (LexState *ls, char *s) { 57void 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
120static int checkcond (LexState *LS, char *buff) { 120static 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
162static void inclinenumber (LexState *LS) { 162static 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;