diff options
author | Robert J. Simmons <robsimmons@gmail.com> | 2011-08-28 11:29:45 -0400 |
---|---|---|
committer | Robert J. Simmons <robsimmons@gmail.com> | 2011-08-28 11:29:45 -0400 |
commit | ec90b0d2bf7b49d9f56c2dbc0029714e6eeaef8f (patch) | |
tree | 5bc9c7bcae09927e4b11d2d698b7d26c8e53f4e2 | |
parent | dc780e1ee3a16ff620c6ef91367bf38b35577463 (diff) | |
download | pygments-ec90b0d2bf7b49d9f56c2dbc0029714e6eeaef8f.tar.gz |
Recognize that symbolic identifiers can live at the end of a sequence of namespaces
-rw-r--r-- | pygments/lexers/functional.py | 1 | ||||
-rw-r--r-- | tests/examplefiles/example.sml | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py index cb783991..dcbec7e9 100644 --- a/pygments/lexers/functional.py +++ b/pygments/lexers/functional.py @@ -641,6 +641,7 @@ class SMLLexer(RegexLexer): 'dotted': [ (r'(%s)(\.)' % alphanumid_re, long_id_callback), (r'(%s)' % alphanumid_re, end_id_callback, "#pop"), + (r'(%s)' % symbolicid_re, end_id_callback, "#pop"), (r'\s+', Error), (r'\S+', Error), ], diff --git a/tests/examplefiles/example.sml b/tests/examplefiles/example.sml index bee45985..31db47d2 100644 --- a/tests/examplefiles/example.sml +++ b/tests/examplefiles/example.sml @@ -1,3 +1,8 @@ +structure C = struct + val a = 12 + fun f x = x + 5 +end + (*(*(*(*(* This file is all pretty strange Standard ML *)*)*)*) (**)*) (* Robert J. Simmons *) @@ -6,7 +11,7 @@ structure S = struct val x = (1, 2, "three") end -structure S = struct +structure Sv = struct (* These look good *) val x = (1, 2, "three") val z = #2 x @@ -16,6 +21,8 @@ structure S = struct val x = {1 = 1, 3 = "three", 2 = 2} val z = # 2 x + + val || = 12 end signature S = sig end @@ -84,7 +91,7 @@ val z = #4 w val z = # ##= w fun f x y 0 = 4 - | f x y z = 4 + | f x y z = 4 + Sv.|| exception Foo of int datatype ('0, 'b, '_, ') f'o'o = Bar | baZ12' | dsfa_fad | #@$ | Bug |