aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-06-20 13:43:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-06-20 13:43:33 -0300
commit55ac40f859ad8e28fe71a8801d49f4a4140e8aa3 (patch)
tree1a1f02de45d28c7eb8976087ade773d7937bed14 /llex.c
parent97ef8e7bd40340d47a9789beb06f0128d7438d0a (diff)
downloadlua-55ac40f859ad8e28fe71a8801d49f4a4140e8aa3.tar.gz
lua-55ac40f859ad8e28fe71a8801d49f4a4140e8aa3.tar.bz2
lua-55ac40f859ad8e28fe71a8801d49f4a4140e8aa3.zip
Cleaning of llimits.h
Several definitions that don't need to be "global" (that is, that concerns only specific parts of the code) moved out of llimits.h, to more appropriate places.
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/llex.c b/llex.c
index 9f20d3c8..3446f4e0 100644
--- a/llex.c
+++ b/llex.c
@@ -32,6 +32,11 @@
32#define next(ls) (ls->current = zgetc(ls->z)) 32#define next(ls) (ls->current = zgetc(ls->z))
33 33
34 34
35/* minimum size for string buffer */
36#if !defined(LUA_MINBUFFER)
37#define LUA_MINBUFFER 32
38#endif
39
35 40
36#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') 41#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
37 42
@@ -159,7 +164,7 @@ static void inclinenumber (LexState *ls) {
159 next(ls); /* skip '\n' or '\r' */ 164 next(ls); /* skip '\n' or '\r' */
160 if (currIsNewline(ls) && ls->current != old) 165 if (currIsNewline(ls) && ls->current != old)
161 next(ls); /* skip '\n\r' or '\r\n' */ 166 next(ls); /* skip '\n\r' or '\r\n' */
162 if (++ls->linenumber >= MAX_INT) 167 if (++ls->linenumber >= INT_MAX)
163 lexerror(ls, "chunk has too many lines", 0); 168 lexerror(ls, "chunk has too many lines", 0);
164} 169}
165 170