[Ur] A simple patch for (int) hexadecimal constants

Gabriel Riba gabriel at xarxaire.com
Thu Feb 26 16:15:54 EST 2015


El 26/02/15 a les 19:46, Gabriel Riba ha escrit:
>
> <INITIAL> {hexconst}  => (case StringCvt.scanString (Int64.scan
> StringCvt.HEX)
>                                      (String.extract (yytext, 2, NONE)) of
>                                SOME x => Tokens.INT (x, pos yypos, pos
> yypos + size yytext)
>                              | NONE   => (ErrorMsg.errorAt' (pos yypos,
> pos yypos)
>                                                             ("Expected
> hexadecimal int, received: " ^ yytext);
>

It seems that I left a line out while copying it (also missing in the 
patch), so it should be

<INITIAL> {hexconst}  => (case StringCvt.scanString (Int64.scan 
StringCvt.HEX) (String.extract (yytext, 2, NONE)) of
                               SOME x => Tokens.INT (x, pos yypos, pos 
yypos + size yytext)
                             | NONE   => (ErrorMsg.errorAt' (pos yypos, 
pos yypos)
                                                            ("Expected 
hexInt, received: " ^ yytext);
                                          continue ()));

although the error branch will never happen.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: urweb.lex.patch
Type: text/x-patch
Size: 1239 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150226/a28d3d17/attachment.bin>


More information about the Ur mailing list