Skip to content

Commit

Permalink
Merge pull request #52 from yui-knk/move_union_under_grammar
Browse files Browse the repository at this point in the history
Move Lrama::Union to Lrama::Grammar::Union
  • Loading branch information
yui-knk authored Jul 8, 2023
2 parents 0983285 + e133f8b commit ea94519
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/lrama.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
require "lrama/states"
require "lrama/states_reporter"
require "lrama/symbol"
require "lrama/union"
require "lrama/version"
require "lrama/warning"
2 changes: 2 additions & 0 deletions lib/lrama/grammar.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require "lrama/grammar/union"
require "lrama/lexer"

module Lrama
Type = Struct.new(:id, :tag, keyword_init: true)
Token = Lrama::Lexer::Token
Expand Down
10 changes: 10 additions & 0 deletions lib/lrama/grammar/union.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Lrama
class Grammar
class Union < Struct.new(:code, :lineno, keyword_init: true)
def braces_less_code
# Remove braces
code.s_value[1..-2]
end
end
end
end
8 changes: 0 additions & 8 deletions lib/lrama/union.rb

This file was deleted.

0 comments on commit ea94519

Please sign in to comment.