lexer: fix `EOF::parser_index` generation.
[nit.git] / src / parser / xss / tokens.xss
index 7a883f7..c1b37cb 100644 (file)
@@ -25,31 +25,19 @@ $ end
 $ end
 class EOF
        super Token
-private init noinit do end
 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()
-
-redef class Token
-    var _text: nullable String
-
-    redef fun text
-    do
-        var res = _text
-        if res != null then return res
-        res = location.text
-       _text = res
-       return res
-    end
-
-    fun parser_index: Int is abstract
-end
-
 $ foreach {//token}
 $ if {@parser_index}
 redef class @ename
@@ -72,22 +60,6 @@ redef class EOF
     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