X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/7142485ab5d515165b44fef36a67426ec0426a64..6ef8077e48b1f859150690080d5860a744cf9150:/lib/build/shell_example_lexer.py diff --git a/lib/build/shell_example_lexer.py b/lib/build/shell_example_lexer.py index c250615..401ad65 100644 --- a/lib/build/shell_example_lexer.py +++ b/lib/build/shell_example_lexer.py @@ -46,12 +46,13 @@ class ShellExampleLexer(RegexLexer): # switch to state input on '$ ' at the start of the line (r"^\$ ", Text, "input"), (r"\s+", Text), - (r"[^#%\s]+", Text), + (r"[^#%\s\\]+", Text), + (r"\\", Text), ], "input": [ include("comments"), include("userinput"), - (r"[^%\\\s]+", Generic.Strong), + (r"[^#%\s\\]+", Generic.Strong), (r"\\\n", Generic.Strong), (r"\\", Generic.Strong), # switch to prev state at non-escaped new-line @@ -62,7 +63,7 @@ class ShellExampleLexer(RegexLexer): (r"#.*\n", Comment.Single), ], "userinput": [ - (r"\\%", Text), + (r"(\\)(%)", bygroups(None, Text)), (r"(%)([^%]*)(%)", bygroups(None, Name.Variable, None)), ], }