Add syntax highlighting for if-else (#4090)
* Add syntax highlighting for if-else * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Confirm --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
@ -2,6 +2,7 @@ import { styleTags, tags as t } from '@lezer/highlight'
|
|||||||
|
|
||||||
export const kclHighlight = styleTags({
|
export const kclHighlight = styleTags({
|
||||||
'fn var let const': t.definitionKeyword,
|
'fn var let const': t.definitionKeyword,
|
||||||
|
'if else': t.controlKeyword,
|
||||||
return: t.controlKeyword,
|
return: t.controlKeyword,
|
||||||
'true false': t.bool,
|
'true false': t.bool,
|
||||||
nil: t.null,
|
nil: t.null,
|
||||||
|
|||||||
@ -40,6 +40,7 @@ expression[@isGroup=Expression] {
|
|||||||
} |
|
} |
|
||||||
UnaryExpression { UnaryOp expression } |
|
UnaryExpression { UnaryOp expression } |
|
||||||
ParenthesizedExpression { "(" expression ")" } |
|
ParenthesizedExpression { "(" expression ")" } |
|
||||||
|
IfExpression { kw<"if"> expression Body kw<"else"> Body } |
|
||||||
CallExpression { expression !call ArgumentList } |
|
CallExpression { expression !call ArgumentList } |
|
||||||
ArrayExpression { "[" commaSep<expression | IntegerRange { expression !range ".." expression }> "]" } |
|
ArrayExpression { "[" commaSep<expression | IntegerRange { expression !range ".." expression }> "]" } |
|
||||||
ObjectExpression { "{" commaSep<ObjectProperty> "}" } |
|
ObjectExpression { "{" commaSep<ObjectProperty> "}" } |
|
||||||
|
|||||||
Reference in New Issue
Block a user