summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Nolta <mike@nolta.net>2012-03-11 00:45:26 -0500
committerMike Nolta <mike@nolta.net>2012-03-11 00:45:26 -0500
commit8db91bc577691c7f4ad2a649a734e5067ce58d32 (patch)
tree0583453a6736037782ae69b8af92db43044ef679
parentc5c00ed78a567237ddfc8d810b461bf8283355d8 (diff)
downloadpygments-8db91bc577691c7f4ad2a649a734e5067ce58d32.tar.gz
bugfixes
-rw-r--r--pygments/lexers/math.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py
index 448ef2d1..92eebef1 100644
--- a/pygments/lexers/math.py
+++ b/pygments/lexers/math.py
@@ -66,17 +66,20 @@ class JuliaLexer(RegexLexer):
bygroups(Keyword,Name.Class), 'typename'),
# operators
- (r'==|!=|<=|>=|->|&&|\|\||::|<:|[-~+/*%=<>&^|.?!]', Operator),
+ (r'==|!=|<=|>=|->|&&|\|\||::|<:|[-~+/*%=<>&^|.?!$]', Operator),
(r'\.\*|\.\^|\.\\|\.\/|\\', Operator),
# builtins
('(' + '|'.join(builtins) + r')\b', Name.Builtin),
# backticks
- (r'`.*?`', String.Backtick),
+ (r'`(?s).*?`', String.Backtick),
# chars
- (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
+ (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'", String.Char),
+
+ # try to match trailing transpose
+ (r'(?<=[.\w\)\]])\'', Operator),
# strings
(r'(?:[IL])"', String, 'string'),
@@ -95,7 +98,9 @@ class JuliaLexer(RegexLexer):
],
'funcname': [
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop')
+ ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop'),
+ ('\([^\s\w{]{1,2}\)', Operator, '#pop'),
+ ('[^\s\w{]{1,2}', Operator, '#pop'),
],
'typename': [
@@ -112,7 +117,7 @@ class JuliaLexer(RegexLexer):
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
(r'\$(\([a-zA-Z0-9_]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?',
String.Interpol),
- (r'[^\\\'"$\n]+', String),
+ (r'[^\\"$]+', String),
# quotes, dollar signs, and backslashes must be parsed one at a time
(r'["\\]', String),
# unhandled string formatting sign