lib/vernacular/ast/ast_parser.rb in vernacular-ast-0.1.0 vs lib/vernacular/ast/ast_parser.rb in vernacular-ast-0.1.1
- old
+ new
@@ -52,10 +52,12 @@
def compile_parser(filepath)
output = PARSER_PATH
exec_path = Gem.activate_bin_path('racc', 'racc', [])
`#{exec_path} --superclass=Parser::Base -o #{output} #{filepath}`
- File.write(output, File.read(output).gsub('Ruby25', 'Vernacular'))
+
+ parser_name = "Ruby#{parser_version}"
+ File.write(output, File.read(output).gsub(parser_name, 'Vernacular'))
end
# rubocop:disable Metrics/MethodLength
def extend_parser(source, parser_extension)
needle = "#{parser_extension.symbol}:"