From 8a099d3b900bd14c213b98fe5b0a298e64917878 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 4 Dec 2015 08:59:13 -0500 Subject: [PATCH] nitcc: move up `text` of token earlier to improve generated code Signed-off-by: Jean Privat --- contrib/nitcc/src/autom.nit | 5 +++++ contrib/nitcc/src/nitcc_semantic.nit | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) 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! -- 1.7.9.5