Repository navigation
YAML issues #12
Description
redundant rule type-inner and invalid include #simple-type
Lines 521 to 527 in 85b79a0
| "type-inner": { | |
| "patterns": [ | |
| { | |
| "include": "#simple-type" | |
| } | |
| ] | |
| }, |
num and boolnull rules are incompatible with TextMate 2.0 and Github-Linguist

Lines 164 to 171 in 85b79a0
| "num": { | |
| "name": "constant.numeric.yaml", | |
| "match": "(?<!![\\t ]+)(?:[+-]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN)|0x[0-9a-fA-F]+|0o[0-7]+|[+-]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)(?:[eE][+-]?[0-9]+)?)(?=[\\t ]+#|[\\t ]*(?:[\\r\\n,\\[\\]{}]|:(?:[\\s,\\[\\]{}]|$))|$)" | |
| }, | |
| "boolnull": { | |
| "name": "constant.language.yaml", | |
| "match": "(?<!![\\t ]+)(?:true|True|TRUE|false|False|FALSE|null|Null|NULL|~)(?=[\\t ]+#|[\\t ]*(?:[\\r\\n,\\[\\]{}]|:(?:[\\s,\\[\\]{}]|$))|$)" | |
| }, |
--- is incorrectly detected as string instead of document
block scalar string incorrectly detected as comment
- >
# detected
anchors not correct detected
? &a a
: &b b
: *a
explicit multiline sequence map key not detected
?
- a
- b
:
- c
- d
escape chars in double quoted block key not detected
"foo\nbar:baz\tx \\$%^&*()x": 23

block scalar ended prematurely
>
folded
line
next
line
* bullet
* list
* lines
incorrect punctuation detected
block: |
void main() {
printf("Hello, world!\n");
}
'keyword.control.flow.block-scalar' should be added to litString
as this will bump the official grammar from 92.4% to 99.5% (and 99.7% after a few simple bug fixes)
for some reason adding meta.scalar does not work?
Line 184 in 85b79a0
| [R.litString]: { tier: 'strict', desc: 'string literal', exact: ['string'], family: ['punctuation.definition.string', 'punctuation'] }, |
Activity
Emit a real begin/end region for YAML block scalars
Give YAML number/bool/null plain scalars a string-scalar ancestor
Read multi-scope leaves in the Monarch and tree-sitter generators
Scope a block scalar in explicit-key position as the key name
Extend the YAML oracle to cover anchors, aliases, doc markers, escapes
Highlight YAML document markers (--- / ...) as document structure
Scope anchors / tags in YAML explicit-key position
Sub-scope escapes inside quoted YAML keys
Resolve remaining YAML #12 items: portable num/boolnull + explicit-ke…
Point YAML ledger explicit-key cases at the specific issue, not the list
Fix the YAML issue ledger: specific cites, drop the mislabeled case
Fix YAML block scalars with empty lines via nested meta.stream emission
RedCMD commentedon Jun 7, 2026
@johnsoncodehk
,inside ans-global-tag-prefixis incorrectly detected asflow.puncthttps://yaml.org/spec/1.2.2/#rule-ns-global-tag-prefix
!inside a comment is incorrectly detected astag.type# Use the ! handle for presentinginvalid.illegal.keyword.other.directive.yamlnot classified asdirectivetest file
SF5V.yamlthe second
%YAML 1.2is an error as defined byfail: truetechnically this should still be highlighted normally
and the error come from an LSP
but it was easy to implement
https://yaml.org/spec/1.2.2/#681-yaml-directives
%YAML 1.2 fooincorrectly highlighted as nothing and unquoted stringescape not highlighted in string

double: "quoted \' scalar"!"#$%&'()*+incorrectly detected astag42incorrectly detected as unquoted string numeric#...incorrectly detected as comment%YAML 1.1#...%YAML 1.2incorrectly detected asdirective# string 5incorrectly detected as commentRebuild the YAML scope-gap metric on an independent CST oracle (#18)
Scope multi-line YAML plain-scalar continuations as string (#12 #6/#7) (
Fold same-column YAML plain-scalar continuations (#12 #9) (#20)
Derive YAML plain-fold region literals from the indent config
Detect YAML plain-scalar folds from the rules instead of a proxy gate
Highlight YAML malformed directives (#4) and explicit-indent block sc…
RedCMD commentedon Jun 10, 2026
comment incorrectly highlighted as string
test file
M5DY.yamlfailsbut Monogram still claims 100%
-in- Chicago cubsshould bepunctuation, notstring[incorrectly highlighted as string instead of flowshould be string not comment
johnsoncodehk commentedon Jun 16, 2026
Hi! My original intention for creating this project was simply to replace the unmaintained TextMate repositories. If you are still willing to maintain https://github.com/RedCMD/YAML-Syntax-Highlighter, would you consider porting https://github.com/johnsoncodehk/monogram/blob/master/yaml.ts into your project? So that we can remove the built-in YAML from Monogram.
If you're open to this, you can refer to the approach used in vuejs/language-tools#6085.
By the way, the level of completeness of https://github.com/RedCMD/YAML-Syntax-Highlighter is amazing!
RedCMD commentedon Jun 17, 2026
Hello allo
It was my intention to maintain the yaml grmmar myself
since it has been unmaintained for years
I have a bunch of fixes queued up to commit at some point
my grammar also supports yaml 1.0 and 1.1 aswell