diff options
author | Akira TAGOH <akira@tagoh.org> | 2006-12-18 16:10:09 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2006-12-18 16:10:09 +0000 |
commit | b1a4c2308bc530fe40b72bfbae93e75fed3b5f6d (patch) | |
tree | b8f60d8e8492811b0c493e1cc21327b025794dc6 | |
parent | 18301bc6f8ee819c0ba59a994970a6f77fe89066 (diff) |
* hieroglyph/scanner.c (_hg_scanner_parse_number): fix a parser to
recognize a special character after numeric.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | hieroglyph/scanner.c | 9 | ||||
-rw-r--r-- | hieroglyph/version.h.in | 2 |
3 files changed, 9 insertions, 5 deletions
@@ -1,5 +1,8 @@ 2006-12-19 Akira TAGOH <at@gclab.org> + * hieroglyph/scanner.c (_hg_scanner_parse_number): fix a parser to + recognize a special character after numeric. + * tests/ps/test-0base.ps: fix a typo. * plugins/test/test-main.c (_test_op_validateunittest): fix a typo. diff --git a/hieroglyph/scanner.c b/hieroglyph/scanner.c index f0328a8..fc40d36 100644 --- a/hieroglyph/scanner.c +++ b/hieroglyph/scanner.c @@ -638,9 +638,7 @@ _hg_scanner_parse_number(HgVM *vm, case HG_SCAN_C_CONTROL: case HG_SCAN_C_NULL: case HG_SCAN_C_SPACE: - need_loop = FALSE; - if (!is_valid) - goto non_numeral_handler; + goto non_numeral_handler; break; case HG_SCAN_C_NAME: is_valid = TRUE; @@ -744,6 +742,8 @@ _hg_scanner_parse_number(HgVM *vm, } if (is_valid) break; + } else { + is_valid = FALSE; } goto non_numeral_handler; case HG_SCAN_C_NUMERAL: @@ -753,6 +753,7 @@ _hg_scanner_parse_number(HgVM *vm, case HG_SCAN_TOKEN_EVAL_NAME: case HG_SCAN_TOKEN_STRING: /* it may be unlikely */ + is_valid = FALSE; goto non_numeral_handler; case HG_SCAN_TOKEN_NAME: if (is_power) { @@ -797,6 +798,7 @@ _hg_scanner_parse_number(HgVM *vm, break; default: hg_log_warning("[BUG] it may be unlikely to appear HG_SCAN_C_NUMERAL in token type %d\n", token_type); + is_valid = FALSE; goto non_numeral_handler; } break; @@ -806,7 +808,6 @@ _hg_scanner_parse_number(HgVM *vm, /* postpone dealing with this */ hg_file_object_ungetc(file, c); need_loop = FALSE; - is_valid = FALSE; break; } } diff --git a/hieroglyph/version.h.in b/hieroglyph/version.h.in index a92aca8..f1b0b46 100644 --- a/hieroglyph/version.h.in +++ b/hieroglyph/version.h.in @@ -29,7 +29,7 @@ G_BEGIN_DECLS #define HIEROGLYPH_VERSION "@VERSION@" -#define HIEROGLYPH_UUID "47ad77e0-bc6c-43b9-902f-6d594b10c3ab" +#define HIEROGLYPH_UUID "12085fa0-d557-4a8e-9b1d-a78a58e3de0f" const char *__hg_rcsid G_GNUC_UNUSED = "$Rev$"; |