]> git.wincent.com - wikitext.git/commitdiff
Add LEFT_CURLY and RIGHT_CURLY symbols
authorWincent Colaiuta <win@wincent.com>
Tue, 19 Feb 2008 08:52:18 +0000 (09:52 +0100)
committerWincent Colaiuta <win@wincent.com>
Tue, 19 Feb 2008 08:52:18 +0000 (09:52 +0100)
In order to avoid ambiguity we have to separately tokenize single curly
braces and exclude them from the standard PRINTABLE rule. Otherwise the
greedy matching behaviour would match a run like "foo{{bar}}baz" as a
single PRINTABLE token rather than a PRINTABLE, IMG_START, PRINTABLE,
IMG_END, PRINTABLE sequence.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/token.c
ext/token.h

index 7446fe5f9e7362e26ae4239ca6ad779679eb057e..5773cc016089f2f473f446218111061126995f09 100644 (file)
@@ -80,6 +80,8 @@ VALUE Wikitext_parser_token_types(VALUE self)
     SET_TOKEN_TYPE(GREATER);
     SET_TOKEN_TYPE(IMG_START);
     SET_TOKEN_TYPE(IMG_END);
+    SET_TOKEN_TYPE(LEFT_CURLY);
+    SET_TOKEN_TYPE(RIGHT_CURLY);
     SET_TOKEN_TYPE(CRLF);
     SET_TOKEN_TYPE(PRINTABLE);
     SET_TOKEN_TYPE(DEFAULT);
index 8d616441225df5143cb9d4d17615f8445595f1f1..42aece3cba6926cd31ac53f2dd6918438739c522 100644 (file)
@@ -86,6 +86,8 @@ enum token_types {
     GREATER,
     IMG_START,
     IMG_END,
+    LEFT_CURLY,
+    RIGHT_CURLY,
     CRLF,
     PRINTABLE,
     DEFAULT,