Commits

Rob Simmons committed 5aaa764

Read SML mailing list, improve example

  • Participants
  • Parent commits 5ccc778

Comments (0)

Files changed (2)

File pygments/lexers/functional.py

         'root': [
             (r'\s', Text),
             (r'false|true|\(\)|\[\]', Keyword.Pseudo),
-            (r'\b(%s)\b' % '|'.join(core_kw), Keyword.Reserved),
-            (r'\b(%s)\b' % '|'.join(sig_kw), Keyword.Reserved),
-            (r'\b(%s)\b' % '|'.join(struct_kw), Keyword.Reserved, 'sdecs'),
-            (r'\b(%s)\b' % '|'.join(datatype_kw), Keyword.Reserved, 'dname'),
-            (r'\b(%s)\b' % '|'.join(type_kw), Keyword.Reserved),
-            (r'\b(%s)\b' % '|'.join(fun_kw), Keyword.Reserved, 'fname'),
-            (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
+            (r'\b(%s)\b(?!\')' % '|'.join(core_kw), Keyword.Reserved),
+            (r'\b(%s)\b(?!\')' % '|'.join(sig_kw), Keyword.Reserved),
+            (r'\b(%s)\b(?!\')' % '|'.join(struct_kw), Keyword.Reserved, 
+             'sdecs'),
+            (r'\b(%s)\b(?!\')' % '|'.join(datatype_kw), Keyword.Reserved, 
+             'dname'),
+            (r'\b(%s)\b(?!\')' % '|'.join(type_kw), Keyword.Reserved),
+            (r'\b(%s)\b(?!\')' % '|'.join(fun_kw), Keyword.Reserved, 'fname'),
+            (r'\b(%s)\b(?!\')' % '|'.join(primitives), Keyword.Type),
             (r'\(\*', Comment.Multiline, 'comment'),
             (r'%s' % '|'.join(keyopts), Operator),
             

File tests/examplefiles/example.sml

 val (foo, ++, bar, ||) = (4, baz.Bar.foo, !%&$#+-/:<=>?@\~`^|*, Bar.foo)
 val _ = $$$foo++bar||
 
-val x : ' list = []
-val x : (' -> ') = fn x => x
-val x : ('a -> 'a) = fn x => x
+val val'ue : ' list = []
+val struct3 : (' -> ') = fn x => x
+val end_struct_' : ('a -> 'a) = fn x => x
 val x : (''a -> ''a) = fn x => x
 val x : ('''' -> '''') = fn x => x
 val x : unit = print "Weird, huh?\n"