nitcc: move up `text` of token earlier to improve generated code
authorJean Privat <jean@pryen.org>
Fri, 4 Dec 2015 13:59:13 +0000 (08:59 -0500)
committerJean Privat <jean@pryen.org>
Fri, 4 Dec 2015 13:59:13 +0000 (08:59 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/nitcc/src/autom.nit
contrib/nitcc/src/nitcc_semantic.nit

index d2ab41d..21d23ee 100644 (file)
@@ -745,6 +745,11 @@ private class DFAGenerator
        end
 end
 
+redef class Token
+       # The associated text (if any, ie defined in the parser part)
+       var text: nullable String is noautoinit, writable
+end
+
 # A state in a finite automaton
 class State
        # Outgoing transitions
index 795cee0..299b46c 100644 (file)
@@ -572,8 +572,6 @@ end
 redef class Token
        # The associated expression (if any, ie defined in the lexer part)
        var nexpr: nullable Nexpr
-       # The associated text (if any, ie defined in the parser part)
-       var text: nullable String
 
        # Build a NFA according to nexpr or text
        # Does not tag it!