summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-11-05 12:32:20 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-11-05 12:32:20 -0400
commite548283b4060c3d43573a4678a5d8d637efeb3fb (patch)
treeb5f87a64931ea06b6e1597e112dc1de60845bb94
parent039c0459b9fd51337a2b17aea1618b423605e636 (diff)
Adjust for different ml-lex behavior between SML/NJ and MLton
-rw-r--r--src/urweb.lex2
-rw-r--r--tests/sigbug.ur3
-rw-r--r--tests/sigbug.urs3
3 files changed, 7 insertions, 1 deletions
diff --git a/src/urweb.lex b/src/urweb.lex
index 21e3d603..19f28738 100644
--- a/src/urweb.lex
+++ b/src/urweb.lex
@@ -416,7 +416,7 @@ xint = x[0-9a-fA-F][0-9a-fA-F];
<INITIAL> "structure" => (Tokens.STRUCTURE (pos yypos, pos yypos + size yytext));
<INITIAL> "signature" => (Tokens.SIGNATURE (pos yypos, pos yypos + size yytext));
<INITIAL> "struct" => (Tokens.STRUCT (pos yypos, pos yypos + size yytext));
-<INITIAL> "sig" => (if yypos = 2 then initialSig () else (); Tokens.SIG (pos yypos, pos yypos + size yytext));
+<INITIAL> "sig" => (if yypos <= 2 then initialSig () else (); Tokens.SIG (pos yypos, pos yypos + size yytext));
<INITIAL> "let" => (Tokens.LET (pos yypos, pos yypos + size yytext));
<INITIAL> "in" => (Tokens.IN (pos yypos, pos yypos + size yytext));
<INITIAL> "end" => (Tokens.END (pos yypos, pos yypos + size yytext));
diff --git a/tests/sigbug.ur b/tests/sigbug.ur
new file mode 100644
index 00000000..ec00343c
--- /dev/null
+++ b/tests/sigbug.ur
@@ -0,0 +1,3 @@
+val z = 3
+val x = 1
+val y = 2
diff --git a/tests/sigbug.urs b/tests/sigbug.urs
new file mode 100644
index 00000000..81693932
--- /dev/null
+++ b/tests/sigbug.urs
@@ -0,0 +1,3 @@
+val x : inta
+val y : into
+val z : introx