diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_cparse.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lj_cparse.c b/src/lj_cparse.c index 4392b7c4..f6cefc0c 100644 --- a/src/lj_cparse.c +++ b/src/lj_cparse.c | |||
@@ -58,14 +58,22 @@ static LJ_AINLINE int cp_iseol(CPChar c) | |||
58 | return (c == '\n' || c == '\r'); | 58 | return (c == '\n' || c == '\r'); |
59 | } | 59 | } |
60 | 60 | ||
61 | static LJ_AINLINE CPChar cp_get(CPState *cp); | ||
62 | |||
63 | /* Peek next raw character. */ | 61 | /* Peek next raw character. */ |
64 | static LJ_AINLINE CPChar cp_rawpeek(CPState *cp) | 62 | static LJ_AINLINE CPChar cp_rawpeek(CPState *cp) |
65 | { | 63 | { |
66 | return (CPChar)(uint8_t)(*cp->p); | 64 | return (CPChar)(uint8_t)(*cp->p); |
67 | } | 65 | } |
68 | 66 | ||
67 | static LJ_NOINLINE CPChar cp_get_bs(CPState *cp); | ||
68 | |||
69 | /* Get next character. */ | ||
70 | static LJ_AINLINE CPChar cp_get(CPState *cp) | ||
71 | { | ||
72 | cp->c = (CPChar)(uint8_t)(*cp->p++); | ||
73 | if (LJ_LIKELY(cp->c != '\\')) return cp->c; | ||
74 | return cp_get_bs(cp); | ||
75 | } | ||
76 | |||
69 | /* Transparently skip backslash-escaped line breaks. */ | 77 | /* Transparently skip backslash-escaped line breaks. */ |
70 | static LJ_NOINLINE CPChar cp_get_bs(CPState *cp) | 78 | static LJ_NOINLINE CPChar cp_get_bs(CPState *cp) |
71 | { | 79 | { |
@@ -78,14 +86,6 @@ static LJ_NOINLINE CPChar cp_get_bs(CPState *cp) | |||
78 | return cp_get(cp); | 86 | return cp_get(cp); |
79 | } | 87 | } |
80 | 88 | ||
81 | /* Get next character. */ | ||
82 | static LJ_AINLINE CPChar cp_get(CPState *cp) | ||
83 | { | ||
84 | cp->c = (CPChar)(uint8_t)(*cp->p++); | ||
85 | if (LJ_LIKELY(cp->c != '\\')) return cp->c; | ||
86 | return cp_get_bs(cp); | ||
87 | } | ||
88 | |||
89 | /* Save character in buffer. */ | 89 | /* Save character in buffer. */ |
90 | static LJ_AINLINE void cp_save(CPState *cp, CPChar c) | 90 | static LJ_AINLINE void cp_save(CPState *cp, CPChar c) |
91 | { | 91 | { |