src/Tools/VSCode/src/grammar.scala
changeset 64745 0f002c15f3ab
parent 64744 ba0d4829d5f1
child 64746 34db87033abe
--- a/src/Tools/VSCode/src/grammar.scala	Mon Jan 02 09:41:25 2017 +0100
+++ b/src/Tools/VSCode/src/grammar.scala	Mon Jan 02 10:22:59 2017 +0100
@@ -52,7 +52,7 @@
   "fileTypes": ["thy"],
   "uuid": """ + JSON.Format(UUID.randomUUID().toString) + """,
   "repository": {
-    "comments": {
+    "comment": {
       "patterns": [
         {
           "name": "comment.block.isabelle",
@@ -60,18 +60,37 @@
           "beginCaptures": {
             "0": { "name": "punctuation.definition.comment.begin.isabelle" }
           },
-          "patterns": [{ "include": "#comments" }],
+          "patterns": [{ "include": "#comment" }],
           "end": "\\*\\)",
           "endCaptures": {
             "0": { "name": "punctuation.definition.comment.end.isabelle" }
           }
         }
       ]
+    },
+    "cartouche": {
+      "patterns": [
+        {
+          "name": "string.quoted.other.multiline.isabelle",
+          "begin": "(?:\\\\<open>|‹)",
+          "beginCaptures": {
+            "0": { "name": "punctuation.definition.string.begin.isabelle" }
+          },
+          "patterns": [{ "include": "#cartouche" }],
+          "end": "(?:\\\\<close>|›)",
+          "endCaptures": {
+            "0": { "name": "punctuation.definition.string.end.isabelle" }
+          }
+        }
+      ]
     }
   },
   "patterns": [
     {
-      "include": "#comments"
+      "include": "#comment"
+    },
+    {
+      "include": "#cartouche"
     },
     {
       "name": "keyword.control.isabelle",
@@ -101,7 +120,7 @@
       },
       "patterns": [
         {
-          "match": "\\\\.",
+          "match": """ + JSON.Format("""\\[\"]|\\\d\d\d""") + """,
           "name": "constant.character.escape.isabelle"
         }
       ],
@@ -109,6 +128,23 @@
       "endCaptures": {
         "0": { "name": "punctuation.definition.string.end.isabelle" }
       }
+    },
+    {
+      "name": "string.quoted.backtick.isabelle",
+      "begin": "`",
+      "beginCaptures": {
+        "0": { "name": "punctuation.definition.string.begin.isabelle" }
+      },
+      "patterns": [
+        {
+          "match": """ + JSON.Format("""\\[\`]|\\\d\d\d""") + """,
+          "name": "constant.character.escape.isabelle"
+        }
+      ],
+      "end": "`",
+      "endCaptures": {
+        "0": { "name": "punctuation.definition.string.end.isabelle" }
+      }
     }
   ]
 }