summaryrefslogtreecommitdiff
path: root/src/lj_lex.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-11-09 12:09:54 +0100
committerMike Pall <mike>2010-11-09 12:09:54 +0100
commitad29c1f39feb55d4d443b9352448a12a1be8ee23 (patch)
tree685adbbcad3f65cacf636dda30bf1785191d9c6e /src/lj_lex.c
parentfe21a42a92546416cc235511c4e1949d850c0139 (diff)
downloadluajit2-ad29c1f39feb55d4d443b9352448a12a1be8ee23.tar.gz
Rename character type handling from lj_ctype* to lj_char*.
Diffstat (limited to 'src/lj_lex.c')
-rw-r--r--src/lj_lex.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lj_lex.c b/src/lj_lex.c
index d02ae849..d3544e8e 100644
--- a/src/lj_lex.c
+++ b/src/lj_lex.c
@@ -15,7 +15,7 @@
#include "lj_str.h"
#include "lj_lex.h"
#include "lj_parse.h"
-#include "lj_ctype.h"
+#include "lj_char.h"
/* Lua lexer token names. */
static const char *const tokennames[] = {
@@ -80,11 +80,11 @@ static void inclinenumber(LexState *ls)
static void read_numeral(LexState *ls, TValue *tv)
{
int c;
- lua_assert(lj_ctype_isdigit(ls->current));
+ lua_assert(lj_char_isdigit(ls->current));
do {
c = ls->current;
save_and_next(ls);
- } while (lj_ctype_isident(ls->current) || ls->current == '.' ||
+ } while (lj_char_isident(ls->current) || ls->current == '.' ||
((ls->current == '-' || ls->current == '+') &&
((c & ~0x20) == 'E' || (c & ~0x20) == 'P')));
save(ls, '\0');
@@ -166,7 +166,7 @@ static void read_string(LexState *ls, int delim, TValue *tv)
case '\n': case '\r': save(ls, '\n'); inclinenumber(ls); continue;
case END_OF_STREAM: continue; /* will raise an error next loop */
default:
- if (!lj_ctype_isdigit(ls->current)) {
+ if (!lj_char_isdigit(ls->current)) {
save_and_next(ls); /* handles \\, \", \', and \? */
} else { /* \xxx */
int i = 0;
@@ -174,7 +174,7 @@ static void read_string(LexState *ls, int delim, TValue *tv)
do {
c = 10*c + (ls->current-'0');
next(ls);
- } while (++i<3 && lj_ctype_isdigit(ls->current));
+ } while (++i<3 && lj_char_isdigit(ls->current));
if (c > 255)
lj_lex_error(ls, TK_string, LJ_ERR_XESC);
save(ls, c);
@@ -200,16 +200,16 @@ static int llex(LexState *ls, TValue *tv)
{
lj_str_resetbuf(&ls->sb);
for (;;) {
- if (lj_ctype_isident(ls->current)) {
+ if (lj_char_isident(ls->current)) {
GCstr *s;
- if (lj_ctype_isdigit(ls->current)) { /* Numeric literal. */
+ if (lj_char_isdigit(ls->current)) { /* Numeric literal. */
read_numeral(ls, tv);
return TK_number;
}
/* Identifier or reserved word. */
do {
save_and_next(ls);
- } while (lj_ctype_isident(ls->current));
+ } while (lj_char_isident(ls->current));
s = lj_parse_keepstr(ls, ls->sb.buf, ls->sb.n);
if (s->reserved > 0) /* Reserved word? */
return TK_OFS + s->reserved;
@@ -282,7 +282,7 @@ static int llex(LexState *ls, TValue *tv)
return TK_dots; /* ... */
}
return TK_concat; /* .. */
- } else if (!lj_ctype_isdigit(ls->current)) {
+ } else if (!lj_char_isdigit(ls->current)) {
return '.';
} else {
read_numeral(ls, tv);
@@ -369,7 +369,7 @@ const char *lj_lex_token2str(LexState *ls, LexToken token)
{
if (token > TK_OFS)
return tokennames[token-TK_OFS-1];
- else if (!lj_ctype_iscntrl(token))
+ else if (!lj_char_iscntrl(token))
return lj_str_pushf(ls->L, "%c", token);
else
return lj_str_pushf(ls->L, "char(%d)", token);