comparison lex.rhope @ 134:386f4a874821

More work on new parser
author Mike Pavone <pavone@retrodev.com>
date Wed, 10 Nov 2010 22:29:49 -0500
parents 1f238280047f
children
comparison
equal deleted inserted replaced
133:e1911b2fd5cc 134:386f4a874821
101 } 101 }
102 102
103 Numeric Literal[literal, text, simple tokens, token list:out] 103 Numeric Literal[literal, text, simple tokens, token list:out]
104 { 104 {
105 first,rest <- [text]Slice[1] 105 first,rest <- [text]Slice[1]
106 If[[first] In ["01234567890.x"]] 106 If[[first] In ["01234567890.xui"]]
107 { 107 {
108 out <- Numeric Literal[[literal]Append[first], rest, simple tokens, token list] 108 out <- Numeric Literal[[literal]Append[first], rest, simple tokens, token list]
109 }{ 109 }{
110 out <- _Lex[text, [first]Slice[0], simple tokens, [token list]Append[Token["Numeric Literal", literal, literal]]] 110 out <- _Lex[text, [first]Slice[0], simple tokens, [token list]Append[Token["Numeric Literal", literal, literal]]]
111 } 111 }
201 } 201 }
202 } 202 }
203 203
204 Lex[text:out] 204 Lex[text:out]
205 { 205 {
206 simple tokens <- [[[[[[[[[[Dictionary[] 206 simple tokens <- [[[[[[[[[[[Dictionary[]
207 ]Set["{", "Block Begin"] 207 ]Set["{", "Block Begin"]
208 ]Set["}", "Block End"] 208 ]Set["}", "Block End"]
209 ]Set["(", "List Begin"] 209 ]Set["(", "List Begin"]
210 ]Set[")", "List End"] 210 ]Set[")", "List End"]
211 ]Set["[", "Args Begin"] 211 ]Set["[", "Args Begin"]
212 ]Set["]", "Args End"] 212 ]Set["]", "Args End"]
213 ]Set[".", "Call Separator"]
213 ]Set[",", "List Separator"] 214 ]Set[",", "List Separator"]
214 ]Set[":", "Name Separator"] 215 ]Set[":", "Name Separator"]
215 ]Set["@", "Method Separator"] 216 ]Set["@", "Method Separator"]
216 ]Set["\n", "Newline"] 217 ]Set["\n", "Newline"]
217 out <- _Lex[text, [text]Slice[0], simple tokens, ()] 218 out <- _Lex[text, [text]Slice[0], simple tokens, ()]