From 7572a9543e0f09a69f84029f3a2ac576dde1db53 Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 24 Feb 2015 18:42:03 +0400 Subject: [PATCH] update syntax docs --- index.html | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/index.html b/index.html index 9e05ed68..e2440eb1 100644 --- a/index.html +++ b/index.html @@ -470,7 +470,6 @@ var fonts = lang.arrayToMap(
this.$rules = {
     "start" : [ {
         token : "text",
-        merge : true,
         regex : "<\\!\\[CDATA\\[",
         next : "cdata"
     },
@@ -480,13 +479,7 @@ var fonts = lang.arrayToMap(
         regex : "\\]\\]>",
         next : "start"
     }, {
-        token : "text",
-        merge : true,
-        regex : "\\s+"
-    }, {
-        token : "text",
-        merge : true,
-        regex : ".+"
+        defaultToken : "text"
     } ]
 };

In this extremly short sample, we're defining some highlighting rules for when Ace detectes a <![CDATA tag. When one is encountered, the tokenizer moves from start into the cdata state. It remains there, applying the text token to any string it encounters. Finally, when it hits a closing ]> symbol, it returns to the start state and continues to tokenize anything else.