Skip to content

Commit

Permalink
Merge pull request #142 from junk0612/rip-handmade-parser
Browse files Browse the repository at this point in the history
Replace NewParser with Parser #Fin
  • Loading branch information
yui-knk authored Oct 19, 2023
2 parents 0be2334 + ee8b242 commit 7ef6f70
Show file tree
Hide file tree
Showing 13 changed files with 1,780 additions and 3,591 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
check_filenames: true
check_hidden: true
ignore_words_file: .codespellignore
exclude_file: lib/lrama/new_parser.rb
exclude_file: lib/lrama/parser.rb
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Check for parser.rb is up to date
run: |
bundle exec rake build:racc_parser
git diff --color --no-ext-diff --ignore-submodules --exit-code lib/lrama/new_parser.rb
git diff --color --no-ext-diff --ignore-submodules --exit-code lib/lrama/parser.rb
steep-check:
runs-on: ubuntu-20.04
strategy:
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ require "bundler/gem_tasks"
namespace "build" do
desc "build parser from parser.y by using Racc"
task :racc_parser do
`bundle exec racc parser.y --embedded -o lib/lrama/new_parser.rb`
`bundle exec racc parser.y --embedded -o lib/lrama/parser.rb`
end

desc "build parser for debugging"
task :racc_verbose_parser do
`bundle exec racc parser.y --embedded -o lib/lrama/new_parser.rb -t --log-file=parser.output`
`bundle exec racc parser.y --embedded -o lib/lrama/parser.rb -t --log-file=parser.output`
end
end
1 change: 0 additions & 1 deletion lib/lrama.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
require "lrama/type"
require "lrama/version"
require "lrama/warning"
require "lrama/new_parser"
require "lrama/new_lexer"
2 changes: 1 addition & 1 deletion lib/lrama/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def run(argv)
warning = Lrama::Warning.new
text = options.y.read
options.y.close if options.y != STDIN
grammar = Lrama::NewParser.new(text).parse
grammar = Lrama::Parser.new(text).parse
states = Lrama::States.new(grammar, warning, trace_state: (options.trace_opts[:automaton] || options.trace_opts[:closure]))
states.compute
context = Lrama::Context.new(states)
Expand Down
Loading

0 comments on commit 7ef6f70

Please sign in to comment.