]> git.lizzy.rs Git - micro.git/commitdiff
Dont take # as comment when preceded by backslash (#2112)
authorHéctor M. Monacci <hector.monacci@gmail.com>
Tue, 1 Jun 2021 23:33:06 +0000 (20:33 -0300)
committerGitHub <noreply@github.com>
Tue, 1 Jun 2021 23:33:06 +0000 (19:33 -0400)
When escaped with a backslash (e.g., inside a regex) the numeral char, ```#```, shouldn't be interpreted as a beginning of comment.

runtime/syntax/nim.yaml

index 2478774fe849462f9907c9e4d206a63227b85d43..c42d4e39be7ce8cdff97fd01f3d5038cd4e52aa9 100644 (file)
@@ -18,7 +18,7 @@ rules:
     - constant.number: "\\b0[bB][01][01_]+\\b"
     - constant.number: "\\b[0-9_]((\\.?)[0-9_]+)?[eE][+\\-][0-9][0-9_]+\\b"
     - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
-    - comment: "[[:space:]]*#.*$"
+    - comment: "[[:space:]]*[^\\\\]#.*$"
     - comment:
         start: "\\#\\["
         end: "\\]\\#"