From: Jean Privat Date: Fri, 4 Dec 2015 13:59:13 +0000 (-0500) Subject: nitcc: move up `text` of token earlier to improve generated code X-Git-Tag: v0.8~52^2~6 X-Git-Url: http://nitlanguage.org?hp=e72eedf293da3adccbc662542663fa6bcb6c19f9 nitcc: move up `text` of token earlier to improve generated code Signed-off-by: Jean Privat --- diff --git a/contrib/nitcc/src/autom.nit b/contrib/nitcc/src/autom.nit index d2ab41d..21d23ee 100644 --- a/contrib/nitcc/src/autom.nit +++ b/contrib/nitcc/src/autom.nit @@ -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 diff --git a/contrib/nitcc/src/nitcc_semantic.nit b/contrib/nitcc/src/nitcc_semantic.nit index 795cee0..299b46c 100644 --- a/contrib/nitcc/src/nitcc_semantic.nit +++ b/contrib/nitcc/src/nitcc_semantic.nit @@ -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!