]> git.lizzy.rs Git - micro.git/commitdiff
Add highlighting for user-defined types (#2107)
authorRosetta H&S <markredmann@icloud.com>
Tue, 1 Jun 2021 23:33:40 +0000 (07:33 +0800)
committerGitHub <noreply@github.com>
Tue, 1 Jun 2021 23:33:40 +0000 (19:33 -0400)
* Added highlighting for user-defined types

Provides automatic highlighting of user-defined types ending with either "_t" or "_T", as is seen in editors such as Nano, or within GitHub itself.

* Update cpp.yaml

runtime/syntax/c.yaml
runtime/syntax/cpp.yaml

index 36fabcdea147ed160536f3bb547b4dc20ffff231..e0bea2ceaa8fb1a48ba1cb584fbbb98f1b8b95b3 100644 (file)
@@ -7,6 +7,7 @@ rules:
     - identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
     - type: "\\b(auto|float|double|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\\b"
     - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
+    - type: "\\b[a-z_][0-9a-z_]+(_t|_T)\\b"
     - type.extended: "\\b(bool)\\b"
     - statement: "\\b(volatile|register)\\b"
     - statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
index c213baa3157fdd675d42fbffd30850090e2ba8b2..0da1da6f5536bc048db612d562fc0caa79ece54c 100644 (file)
@@ -7,6 +7,7 @@ rules:
     - identifier: "\\b[A-Z_][0-9A-Z_]*\\b"
     - type: "\\b(float|double|bool|char|int|short|long|enum|void|struct|union|typedef|(un)?signed|inline)\\b"
     - type: "\\b(((s?size)|((u_?)?int(8|16|32|64|ptr))|char(8|16|32))_t|wchar_t)\\b"
+    - type: "\\b[a-z_][0-9a-z_]+(_t|_T)\\b"
     - type: "\\b(final|override)\\b"
     - type.keyword: "\\b(auto|volatile|const(expr|eval|init)?|mutable|register|thread_local|static|extern|decltype|explicit|virtual)\\b"
     - statement: "\\b(class|namespace|template|typename|this|friend|using|public|protected|private|noexcept)\\b"