Lrama v0.5.0 (#7814)
This commit is contained in:
parent
c7067ed13d
commit
41dccb6a7b
Notes:
git
2023-05-15 10:01:28 +00:00
Merged-By: yui-knk <spiketeika@gmail.com>
@ -57,14 +57,18 @@ module Lrama
|
|||||||
end
|
end
|
||||||
|
|
||||||
if !grammar_file
|
if !grammar_file
|
||||||
puts "File should be specified\n"
|
abort "File should be specified\n"
|
||||||
exit 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Report::Duration.enable if trace_opts[:time]
|
Report::Duration.enable if trace_opts[:time]
|
||||||
|
|
||||||
warning = Lrama::Warning.new
|
warning = Lrama::Warning.new
|
||||||
y = File.read(grammar_file)
|
if grammar_file == '-'
|
||||||
|
grammar_file = argv.shift or abort "File name for STDIN should be specified\n"
|
||||||
|
y = STDIN.read
|
||||||
|
else
|
||||||
|
y = File.read(grammar_file)
|
||||||
|
end
|
||||||
grammar = Lrama::Parser.new(y).parse
|
grammar = Lrama::Parser.new(y).parse
|
||||||
states = Lrama::States.new(grammar, warning, trace_state: (trace_opts[:automaton] || trace_opts[:closure]))
|
states = Lrama::States.new(grammar, warning, trace_state: (trace_opts[:automaton] || trace_opts[:closure]))
|
||||||
states.compute
|
states.compute
|
||||||
|
@ -53,9 +53,7 @@ module Lrama
|
|||||||
if @header_out
|
if @header_out
|
||||||
@header_out << tmp
|
@header_out << tmp
|
||||||
else
|
else
|
||||||
File.open(@header_file_path, "w+") do |f|
|
File.write(@header_file_path, tmp)
|
||||||
f << tmp
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
module Lrama
|
module Lrama
|
||||||
VERSION = "0.4.0".freeze
|
VERSION = "0.5.0".freeze
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user