diff --git a/lib/lrama.rb b/lib/lrama.rb index 880e64df..9e517b0d 100644 --- a/lib/lrama.rb +++ b/lib/lrama.rb @@ -13,6 +13,5 @@ require "lrama/state" require "lrama/states" require "lrama/states_reporter" -require "lrama/type" require "lrama/version" require "lrama/warning" diff --git a/lib/lrama/grammar.rb b/lib/lrama/grammar.rb index 7b1a4034..5251eaa0 100644 --- a/lib/lrama/grammar.rb +++ b/lib/lrama/grammar.rb @@ -9,9 +9,9 @@ require "lrama/grammar/rule" require "lrama/grammar/rule_builder" require "lrama/grammar/symbol" +require "lrama/grammar/type" require "lrama/grammar/union" require "lrama/lexer" -require "lrama/type" module Lrama # Grammar is the result of parsing an input grammar file diff --git a/lib/lrama/grammar/type.rb b/lib/lrama/grammar/type.rb new file mode 100644 index 00000000..6861d9f8 --- /dev/null +++ b/lib/lrama/grammar/type.rb @@ -0,0 +1,6 @@ +module Lrama + class Grammar + class Type < Struct.new(:id, :tag, keyword_init: true) + end + end +end diff --git a/lib/lrama/type.rb b/lib/lrama/type.rb deleted file mode 100644 index fe5ff740..00000000 --- a/lib/lrama/type.rb +++ /dev/null @@ -1,4 +0,0 @@ -module Lrama - class Type < Struct.new(:id, :tag, keyword_init: true) - end -end diff --git a/spec/lrama/parser_spec.rb b/spec/lrama/parser_spec.rb index 0697e533..03e9cf30 100644 --- a/spec/lrama/parser_spec.rb +++ b/spec/lrama/parser_spec.rb @@ -1,6 +1,6 @@ RSpec.describe Lrama::Parser do T ||= Lrama::Lexer::Token - Type = Lrama::Type + Type = Lrama::Grammar::Type Sym = Lrama::Grammar::Symbol Precedence = Lrama::Grammar::Precedence Rule = Lrama::Grammar::Rule