[Ur] Problem with character literals with tested solution

gabriel at xarxaire.com gabriel at xarxaire.com
Thu Feb 26 11:36:50 EST 2015


Adding:

val chTest: char = 'a'

gives: Unification failure
Expression:  "a"
   Have con:  string
   Need con:  char

I have found the probable cause in urweb.lex where the apostrophe  
detection in state INITIAL enters the STRING state instead of the CHAR  
state.

Here is a partial listing of the patch:

-<INITIAL> "'"         => (YYBEGIN STRING; strEnder := #"'"; strStart  
:= pos yypos; str := []; continue());
+<INITIAL> "'"         => (YYBEGIN CHAR; strEnder := #"'"; strStart :=  
pos yypos; str := []; continue());






More information about the Ur mailing list