diff options
author | Mike Pall <mike> | 2013-05-12 23:52:09 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-05-12 23:52:09 +0200 |
commit | 19a9206caf1df71308bd8e4bd61c082026c6811c (patch) | |
tree | ff4827d89b46e6b6d0bc4ab90110496d6e8387be /src/lj_lex.c | |
parent | 7d5acc29181a5194b05fd4650b9e28e4c4978ad1 (diff) | |
download | luajit-19a9206caf1df71308bd8e4bd61c082026c6811c.tar.gz luajit-19a9206caf1df71308bd8e4bd61c082026c6811c.tar.bz2 luajit-19a9206caf1df71308bd8e4bd61c082026c6811c.zip |
Refactor internal string formatting.
Diffstat (limited to 'src/lj_lex.c')
-rw-r--r-- | src/lj_lex.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_lex.c b/src/lj_lex.c index c988a6c1..7c2c6677 100644 --- a/src/lj_lex.c +++ b/src/lj_lex.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "lj_parse.h" | 25 | #include "lj_parse.h" |
26 | #include "lj_char.h" | 26 | #include "lj_char.h" |
27 | #include "lj_strscan.h" | 27 | #include "lj_strscan.h" |
28 | #include "lj_strfmt.h" | ||
28 | 29 | ||
29 | /* Lua lexer token names. */ | 30 | /* Lua lexer token names. */ |
30 | static const char *const tokennames[] = { | 31 | static const char *const tokennames[] = { |
@@ -444,9 +445,9 @@ const char *lj_lex_token2str(LexState *ls, LexToken tok) | |||
444 | if (tok > TK_OFS) | 445 | if (tok > TK_OFS) |
445 | return tokennames[tok-TK_OFS-1]; | 446 | return tokennames[tok-TK_OFS-1]; |
446 | else if (!lj_char_iscntrl(tok)) | 447 | else if (!lj_char_iscntrl(tok)) |
447 | return lj_str_pushf(ls->L, "%c", tok); | 448 | return lj_strfmt_pushf(ls->L, "%c", tok); |
448 | else | 449 | else |
449 | return lj_str_pushf(ls->L, "char(%d)", tok); | 450 | return lj_strfmt_pushf(ls->L, "char(%d)", tok); |
450 | } | 451 | } |
451 | 452 | ||
452 | /* Lexer error. */ | 453 | /* Lexer error. */ |