Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt feedbacks from upstream #42

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions example/official.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ package {
}
}
}

// https://github.com/zyedidia/micro/pull/3549
examples-micro-3549 {
// https://github.com/zyedidia/micro/pull/3549#discussion_r1858298053
node-null null
}
18 changes: 5 additions & 13 deletions kdl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
filetype: 'kdl'

detect:
filename: "\\.kdl"
filename: "\\.kdl$"

rules:
# Punctuation
Expand Down Expand Up @@ -40,25 +40,17 @@ rules:
# Float
- constant.number: '[-+]?(\d+)\.\d*'
# Boolean and inf, nan without sign
# `\s` might be better than `\b` for separators? `foo-contantish` pattern is available for KDL node
- constant.bool.true: '\btrue\b'
- constant.bool.false: '\bfalse\b'
- constant: '\bnull\b'
# Comments
- comment:
start: '//'
end: '$'
rules:
- todo: '(TODO|FIXME|XXX|NOTE)'
# Slashdash comments
# Unavailable to support Slashdash comments
# https://github.com/kdl-org/kdl/blob/de1dbd2c330c9193b836499db241787484627c3b/SPEC.md#L77-L79
# vscode extension realizes this with lookahead and lookbehind, the regex feature cannot be used in micro
# https://github.com/kdl-org/vscode-kdl/blob/646d7b819d72b2f0d9dd05102a305506bafa3cf6/syntaxes/kdl.tmLanguage.json#L182-L199
# https://github.com/zyedidia/micro/issues/901#issuecomment-354931928
# So simplified it, it means this is inaccurate
- comment.block:
start: '^\s*/-'
end: '\s'
rules: []
- comment.block:
start: '/-{'
end: '}'
rules: []
# It is hard to support much of the use-case, so omitted. See https://github.com/zyedidia/micro/pull/3549#discussion_r1858265630