mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-01 14:47:13 -04:00
Fix bugs in syntax files
Fix various bugs in syntax files. Add c++ syntax file. Only save last line's endstate in highlight function.
This commit is contained in:
@@ -10,7 +10,7 @@ rules:
|
||||
- type: "\\b[A-Za-z0-9_]*_t\\b"
|
||||
- type: "\\bdispatch_[a-zA-Z0-9_]*_t\\b"
|
||||
|
||||
- statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" "__unused" "_Nonnull" "_Nullable" "__block" "__builtin.*"
|
||||
- statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__|__unused|_Nonnull|_Nullable|__block|__builtin.*)"
|
||||
- statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b"
|
||||
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
|
||||
- statement: "\\b(try|throw|catch|operator|new|delete)\\b"
|
||||
@@ -21,12 +21,12 @@ rules:
|
||||
- preproc: "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$"
|
||||
- preproc: "__[A-Z0-9_]*__"
|
||||
|
||||
- special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\/?[>|\"][[:space:]]*$"
|
||||
- special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\\/?[>|\"][[:space:]]*$"
|
||||
|
||||
- statement: "[.:;,+*|=!\\%\\[\\]]" "<" ">" "/" "-" "&"
|
||||
- statement: "([.:;,+*|=!\\%\\[\\]]|<|>|/|-|&)"
|
||||
|
||||
- constant.number: "\\b(-?)?[0-9]+\\b" "\\b\\[0-9]+\\.[0-9]+\\b" "\\b0x[0-9A-F]+\\b"
|
||||
- constant: "@\\[(\\\\.|[^\\]])*\\]" "@\\{(\\\\.|[^\\}])*\\}" "@\\((\\\\.|[^\\)])*\\)"
|
||||
- constant.number: "(\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9A-F]+\\b)"
|
||||
- constant: "(@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\))"
|
||||
- constant: "\\b<(\\\\.[^\\>])*\\>\\b"
|
||||
- constant: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\\b"
|
||||
- constant: "\\bk[[:alnum]]*\\b"
|
||||
|
||||
Reference in New Issue
Block a user