Skip to content

Commit

Permalink
fix(grammar): capture end of python|init python blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
LuqueDaniel committed Apr 3, 2022
1 parent 082a13f commit 944d852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"scopeName": "source.renpy",
"path": "./syntaxes/renpy.tmLanguage_2.json",
"embeddedLanguages": {
"embedded.python": "python"
"meta.embedded.python": "python"
}
}
],
Expand Down
8 changes: 4 additions & 4 deletions syntaxes/renpy.tmLanguage_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"patterns": [
{
"comments": "[TODO: REDO] Renpy python block",
"name": "embedded.python.block",
"begin": "^(init\\s-?\\d?\\s?)?(python:)",
"name": "meta.embedded.python.block",
"begin": "^(\\s*)(init\\s-?\\d*\\s?)?(python(\\searly)?(\\sin\\s\\w+)?)",
"beginCaptures": {
"0": {
"patterns": [{ "include": "#renpy-keywords" }]
}
},
"end": "^(?=\\S)",
"end": "^\\1(?=\\S)|^(?=\\S)",
"patterns": [{ "include": "source.python" }]
},
{
"comment": "Match begin and end of python one line statements",
"name": "embedded.python.one-line",
"name": "meta.embedded.python.single-line",
"begin": "(?<=(\\$|define|default)\\s)",
"end": "\\R$",
"patterns": [{ "include": "source.python" }]
Expand Down

0 comments on commit 944d852

Please sign in to comment.