Skip to content

Commit

Permalink
Merge pull request #130 from JelleInfinity/fix-comments
Browse files Browse the repository at this point in the history
fix: Ignore comments in line continuation
  • Loading branch information
duckdoom4 authored May 30, 2022
2 parents 39b0b54 + d0f59ee commit 073f9af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/game/script.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ init python hide early in Namespace:
"""
This is a sample function.
"""
# test
renpy.pause(delay)
return name

Expand Down
2 changes: 1 addition & 1 deletion src/tokenizer/token-patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ const pythonStatements: TokenPattern = {
},
},
// eslint-disable-next-line no-useless-escape
end: /(?:(?<!\1|[^ \t])|^)(?=(?:[ \t]|^)(?!$)[^ \t])|\Z/gm,
end: /(?:(?<!\1|[^ \t])|^)(?=(?:[ \t]|^)(?!$|#)[^ \t])|\Z/gm,
patterns: [pythonSource],
},
{
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/renpy.tmLanguage_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"7": { "name": "punctuation.section.python.begin.renpy" }
},
"end": "(?:(?<!\\1|[^ \\t])|^)(?=(?:[ \\t]|^)(?!$)[^ \\t])",
"end": "(?:(?<!\\1|[^ \\t])|^)(?=(?:[ \\t]|^)(?!$|#)[^ \\t])",
"patterns": [{ "include": "source.python" }]
},
{
Expand Down

0 comments on commit 073f9af

Please sign in to comment.