Skip to content

Commit

Permalink
Fixes Frontmatter #37 and support liquid line comments
Browse files Browse the repository at this point in the history
  • Loading branch information
panoply committed Sep 5, 2022
1 parent a3d116b commit 3c3bc61
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions src/syntax/liquid.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"foldingStopMarker": "(?x){%-?\\s*(endif|endunless|endfor|endpaginate|endcapture|endform|endcase|endtablerow|endraw|endcomment|endblock|endpaginate|endschema|endstylesheet|endjavascript)[^(%})]+-?%}",
"patterns": [
{
"include": "#comments"
"include": "#block-comments"
},
{
"include": "#line-comments"
},
{
"include": "#frontmatter"
Expand Down Expand Up @@ -197,11 +200,16 @@
}
]
},
"comments": {
"block-comments": {
"name": "comment.block.liquid",
"begin": "{%-?\\s*comment\\s*-?%}",
"end": "{%-?\\s*endcomment\\s*-?%}"
},
"line-comments": {
"name": "comment.line.liquid",
"begin": "{%-?\\s*#",
"end": "-?%}"
},
"constant-characters": {
"name": "constant.character.entity.liquid",
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
Expand All @@ -223,33 +231,22 @@
"match": "(-|\\+)?\\s*[0-9]+(\\.[0-9]+)?"
},
"entity-name-tag": {
"match": "(((?<={%)|(?<={%-))\\s*(\\w+))",
"match": "(((?<={\\%)|(?<={\\%-))\\s*(\\w+))",
"captures": {
"1":{
"name": "entity.name.tag.liquid"
}
}
},
"frontmatter": {
"contentName": "source.yaml",
"name": "meta.embedded.block.frontmatter.liquid",
"begin": "---(?=\\s*\\n)",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.liquid"
}
},
"end": "---(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.liquid"
}
},
"patterns": [
{
"include": "source.yaml"
}
]
"contentName": "meta.embedded.block.frontmatter",
"begin": "\\A-{3}\\s*$",
"patterns": [
{
"include": "source.yaml"
}
],
"end": "(^|\\G)-{3}|\\.{3}\\s*$"
},
"include-tag":{
"name": "string.quoted.liquid",
Expand Down Expand Up @@ -297,15 +294,11 @@
"match": "/=",
"name": "keyword.operator.assignment.augmented.liquid"
},


"object-properties": {
"match": "(?<=\\w.)(?<=\\w.)\\b\\w+?\\b\\s+?",
"name": "variable.parameter.liquid"

},


"string-quoted-single": {
"name": "string.quoted.single.liquid",
"begin": "'",
Expand Down

0 comments on commit 3c3bc61

Please sign in to comment.