From bd16ce00f24ecd4b0f2293003f4dc03b09384f66 Mon Sep 17 00:00:00 2001 From: Adam Wick Date: Thu, 13 Jan 2011 11:26:47 -0800 Subject: [PATCH] Add lexer support for comments. --- bsrc/Data/List.bs | 1 + hsrc/Syntax/Lexer.x | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bsrc/Data/List.bs b/bsrc/Data/List.bs index f90d697..414afde 100644 --- a/bsrc/Data/List.bs +++ b/bsrc/Data/List.bs @@ -1,5 +1,6 @@ module Data.List +/* This is a comment */ export datatype List a = NULL() | (:)(a,List a); diff --git a/hsrc/Syntax/Lexer.x b/hsrc/Syntax/Lexer.x index 1b1e399..c512134 100644 --- a/hsrc/Syntax/Lexer.x +++ b/hsrc/Syntax/Lexer.x @@ -21,14 +21,14 @@ $bindigit = [01] $typestart = [A-Z\_] $valstart = [a-z\_] $identrest = [a-zA-Z0-9\_\.] -$opident = [\~\!\@\#\$\%\^\&\*\+\-\=\.\:\<\>\?\/\_] +$opident = [\~\!\@\#\$\%\^\&\*\+\-\=\.\:\<\>\?\_] $escape_char = [abfnrtv'\"\\] :- -- Whitespace $white+ ; - "--".* ; + "/*".*"*/" ; -- Numbers $decdigit+ { emitS (buildInt 10) }