nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grammar: add expr.namedargs
[nit.git]
/
src
/
parser
/
xss
/
tokens.xss
diff --git
a/src/parser/xss/tokens.xss
b/src/parser/xss/tokens.xss
index
6bb6925
..
c1b37cb
100644
(file)
--- a/
src/parser/xss/tokens.xss
+++ b/
src/parser/xss/tokens.xss
@@
-25,22
+25,19
@@
$ end
$ end
class EOF
super Token
$ end
class EOF
super Token
-private init noinit do end
end
class PError
super EOF
end
class PError
super EOF
-private init noinit do end
+end
+class PLexerError
+ super PError
+end
+class PParserError
+ super PError
end
$ end template
$ template make_tokens()
end
$ end template
$ template make_tokens()
-
-redef class Token
- redef readable var _text: String
-
- fun parser_index: Int is abstract
-end
-
$ foreach {//token}
$ if {@parser_index}
redef class @ename
$ foreach {//token}
$ if {@parser_index}
redef class @ename
@@
-49,15
+46,8
@@
redef class @ename
return @parser_index
end
return @parser_index
end
-$ if {not(@text)}
- init init_tk(text: String, loc: Location)
- do
- _text = text
-$ else
init init_tk(loc: Location)
do
init init_tk(loc: Location)
do
- _text = once "${sablecc:string2escaped_unicode(@text)}"
-$ end
_location = loc
end
end
_location = loc
end
end
@@
-70,22
+60,6
@@
redef class EOF
do
return ${tokens/eof/@parser_index}
end
do
return ${tokens/eof/@parser_index}
end
-
- init(loc: Location)
- do
- _text = ""
- _location = loc
- end
-end
-
-redef class PError
- readable var _message: String
-
- init init_error(message: String, loc: Location)
- do
- init(loc)
- _message = message
- end
end
$ end template
end
$ end template