Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed Java keywords and added Scala keywords

  • Loading branch information...
commit 9095072080c8da45c782c6fdbc1a25a23d2c75a0 1 parent a5f11a4
Justin Camerer authored June 07, 2008

Showing 1 changed file with 9 additions and 10 deletions. Show diff stats Hide diff stats

  1. 19  scala_lexer.py
19  scala_lexer.py
@@ -18,15 +18,14 @@ class ScalaLexer(RegexLexer):
18 18
            (r'//.*?\n', Comment),
19 19
            (r'/\*.*?\*/', Comment),
20 20
            (r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
21  
-           (r'(abstract|assert|break|case|catch|'
22  
-            r'const|continue|default|do|else|enum|extends|final|'
23  
-            r'finally|for|if|goto|implements|instanceof|'
24  
-            r'native|new|package|private|protected|public|'
25  
-            r'return|static|strictfp|super|switch|synchronized|this|'
26  
-            r'throw|throws|transient|try|volatile|while|override|with)\b', Keyword),
  21
+           (r'(abstract|case|catch|class|do|else|extends|false|final|'
  22
+            r'finally|for|forSome|if|implicit|import|lazy|match|new|null|'
  23
+            r'object|override|package|private|protected|requires|return|'
  24
+            r'sealed|super|this|throw|trait|try|true|type|while|with|yield|'
  25
+            r'_|:|=|=>|<-|<:|<%|>:|#|@)\b', Keyword),
27 26
            (r'(if|else|(else\s*if)|match|case)', Keyword),
28  
-           (r'(def|var|val)', Keyword),
29  
-           (r'(String|Char|Int)', Keyword.Type),
  27
+           (r'(def|var|val)', Keyword.Declaration),
  28
+           (r'(String|Char|Int|Float|Double|Boolean)', Keyword.Type),
30 29
            (r'(boolean|byte|char|double|float|int|long|short|void)\b',
31 30
             Keyword.Type),
32 31
            (r'(true|false|null|\(\))\b', Keyword.Constant),
@@ -37,10 +36,10 @@ class ScalaLexer(RegexLexer):
37 36
            (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
38 37
            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
39 38
            (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
40  
-           (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
  39
+           #(r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
41 40
            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
42 41
            (r'0x[0-9a-f]+', Number.Hex),
43  
-           (r'[0-9]+L?', Number.Integer),
  42
+           (r'[0-9]+', Number.Integer),
44 43
            (r'\n', Text)
45 44
        ],
46 45
        'class': [

0 notes on commit 9095072

Please sign in to comment.
Something went wrong with that request. Please try again.