Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adjust regex for comments; handle the children builtin (#886)
Co-authored-by: Jean Abou-Samra <[email protected]>
  • Loading branch information
nantipov and jeanas authored Jun 14, 2023
commit 93bd3765a4b6ffaca92c806087d415e107e34577
6 changes: 3 additions & 3 deletions pygments/lexers/openscad.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class OpenScadLexer(RegexLexer):
), prefix=r"\b", suffix=r"\b"),
Name.Builtin
),
(words(("children"), prefix=r"\b", suffix=r"\b"), Name.Builtin.Pseudo),
(r"\bchildren\b", Name.Builtin.Pseudo),
(r'""".*?"""', String.Double),
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
(r"-?\d+(\.\d+)?(e[+-]?\d+)?", Number),
Expand All @@ -86,11 +86,11 @@ class OpenScadLexer(RegexLexer):
'comment-single': [
(r'\n', Text, '#pop'),
include('comment'),
(r'[^\n]', Comment.Single)
(r'[^\n]+', Comment.Single)
],
'comment-multi': [
include('comment'),
(r'[^*/]', Comment.Multiline),
(r'[^*/]+', Comment.Multiline),
(r'/\*', Comment.Multiline, '#push'),
(r'\*/', Comment.Multiline, '#pop'),
(r'[*/]', Comment.Multiline)
Expand Down