Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /smlnj-lib/trunk/JSON/json.lex
ViewVC logotype

Diff of /smlnj-lib/trunk/JSON/json.lex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3002, Tue Apr 22 16:40:11 2008 UTC revision 3003, Wed Apr 23 13:32:55 2008 UTC
# Line 14  Line 14 
14    fun eof () = T.EOF    fun eof () = T.EOF
15    fun int s = T.INT(valOf(IntInf.fromString s))    fun int s = T.INT(valOf(IntInf.fromString s))
16    fun float s = T.FLOAT(valOf(LargeReal.fromString s))    fun float s = T.FLOAT(valOf(LargeReal.fromString s))
17  )  (* support for incremental construction of strings *)
18      val sbuf : string list ref = ref []
19      fun addStr s = sbuf := s :: !sbuf
20      fun finishString () = (String.concat(List.rev(!sbuf)) before sbuf := [])
21    );
22    
23  %let digit1_9 = [1-9];  %let digit1_9 = [1-9];
24  %let digit = [0-9];  %let digit = [0-9];
25  %let digits = {digit}+;  %let digits = {digit}+;
26  %let int = "-"?({digit} | {digit1_9}{digits}+);  %let int = "-"?({digit} | {digit1_9}{digits}+);
27  %let frac = "."{num};  %let frac = "."{digits};
28  %let exp = [eE][+-]?{digits};  %let exp = [eE][+-]?{digits};
29  %let xdigit = {digit}|[a-fA-F];  %let xdigit = {digit}|[a-fA-F];
30    
# Line 56  Line 60 
60  <S>[^\\"]+              => ( addStr yytext; continue() );  <S>[^\\"]+              => ( addStr yytext; continue() );
61  <S>"\""                 => ( YYBEGIN INITIAL; finishString() );  <S>"\""                 => ( YYBEGIN INITIAL; finishString() );
62    
63  "/*"^(.*"*/".*)"*/"     => ( skip() );  "/*"~(.*"*/".*)"*/"     => ( skip() );

Legend:
Removed from v.3002  
changed lines
  Added in v.3003

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0