diff options
| author | Mike Pall <mike> | 2013-08-03 14:24:14 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2013-08-03 14:24:14 +0200 |
| commit | f5fba4838649d83a58cca90474929a1f0f70cf8c (patch) | |
| tree | 9c62dc663c9a67d062a6effab63318345b0e41c4 /src | |
| parent | 92a3cf469c560bb82ac38fe7a18eb747fae197c9 (diff) | |
| parent | 99d588b06a0972f3ea84cad528004891ea8bc0e3 (diff) | |
| download | luajit-f5fba4838649d83a58cca90474929a1f0f70cf8c.tar.gz luajit-f5fba4838649d83a58cca90474929a1f0f70cf8c.tar.bz2 luajit-f5fba4838649d83a58cca90474929a1f0f70cf8c.zip | |
Merge branch 'master' into v2.1
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 | { |
