Add lexer support for comments.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
module Data.List
|
module Data.List
|
||||||
|
|
||||||
|
/* This is a comment */
|
||||||
export datatype List a =
|
export datatype List a =
|
||||||
NULL()
|
NULL()
|
||||||
| (:)(a,List a);
|
| (:)(a,List a);
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ $bindigit = [01]
|
|||||||
$typestart = [A-Z\_]
|
$typestart = [A-Z\_]
|
||||||
$valstart = [a-z\_]
|
$valstart = [a-z\_]
|
||||||
$identrest = [a-zA-Z0-9\_\.]
|
$identrest = [a-zA-Z0-9\_\.]
|
||||||
$opident = [\~\!\@\#\$\%\^\&\*\+\-\=\.\:\<\>\?\/\_]
|
$opident = [\~\!\@\#\$\%\^\&\*\+\-\=\.\:\<\>\?\_]
|
||||||
$escape_char = [abfnrtv'\"\\]
|
$escape_char = [abfnrtv'\"\\]
|
||||||
|
|
||||||
:-
|
:-
|
||||||
|
|
||||||
-- Whitespace
|
-- Whitespace
|
||||||
$white+ ;
|
$white+ ;
|
||||||
"--".* ;
|
"/*".*"*/" ;
|
||||||
|
|
||||||
-- Numbers
|
-- Numbers
|
||||||
$decdigit+ { emitS (buildInt 10) }
|
$decdigit+ { emitS (buildInt 10) }
|
||||||
|
|||||||
Reference in New Issue
Block a user