Permalink
Browse files

Added Roy lexer to pyg.

  • Loading branch information...
1 parent f7a43fe commit 341d30642fcb99efe2d852645d9c9bc87a40c28a @amasad amasad committed Dec 16, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 pyg.py
View
@@ -143,6 +143,22 @@ class ForthLexer(FactorLexer):
aliases = ['forth']
filenames = ['*.4th']
+class RoyLexer(RegexLexer):
+ name = 'Roy'
+ aliases = ['roy']
+ filenames = ['*.roy']
+
+ tokens = {
+ 'root': [
+ (r'//.*\n', Comment.Single),
+ (r'\b(true|false|let|fn|if|then|else|data|type|match|case|do|return|macro|with)\b', Keyword),
+ (r'-?\d+', Literal.Number),
+ (r'\"[^"]*\"', Literal.String),
+ (r'<-|->|=|==|!=|\*|\+\+|\\', Operator),
+ (r'.', Text)
+ ]
+ }
+
def getLexer(lexer_name):
lexers = [value for name, value in globals().items()
if name.endswith('Lexer') and hasattr(value, 'aliases')]

0 comments on commit 341d306

Please sign in to comment.