Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

string handling changed

  • Loading branch information...
commit 68ce7406dfcb746636c6cf0fbc7b8d542a7c07a7 1 parent c6d7d1d
@cormullion authored
Showing with 15 additions and 6 deletions.
  1. +15 −6 pygments-newlisp/functional.py
View
21 pygments-newlisp/functional.py 100644 → 100755
@@ -791,10 +791,12 @@ class NewLispLexer(RegexLexer):
# strings, symbols and characters
(r'"(\\\\|\\"|[^"])*"', String),
- (r'{(\\\\|\\}|[^}])*}', String),
+
+ # braces
+ (r"{", String, "bracestring"),
# [text] ... [/text] delimited strings
- (r'\[text\]*', String.Other, "stringtag"),
+ (r'\[text\]*', String, "tagstring"),
# 'special' operators...
(r"('|:)", Operator),
@@ -815,8 +817,15 @@ class NewLispLexer(RegexLexer):
(r'(\(|\))', Punctuation),
],
- # one way to do [text]...[/text] delimited strings...
- 'stringtag': [
- (r'(?s)(.*?)(\[/text\])', String.Other, '#pop'),
- ],
+ # braced strings...
+ 'bracestring': [
+ ("{", String, "#push"),
+ ("}", String, "#pop"),
+ ("[^{}]+", String),
+ ],
+
+ # tagged [text]...[/text] delimited strings...
+ 'tagstring': [
+ (r'(?s)(.*?)(\[/text\])', String, '#pop'),
+ ],
}
Please sign in to comment.
Something went wrong with that request. Please try again.