From a064e46762ec0bfd40e6a04242d9e62fdd21e1f0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 17 Jun 2019 03:09:52 +0900 Subject: Support Bison 3 --- tool/pure_parser.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tool/pure_parser.rb (limited to 'tool') diff --git a/tool/pure_parser.rb b/tool/pure_parser.rb new file mode 100755 index 0000000000..20d71079a0 --- /dev/null +++ b/tool/pure_parser.rb @@ -0,0 +1,15 @@ +#!/usr/bin/ruby -pi +BEGIN { + require_relative 'colorize' + + colorize = Colorize.new + file = ARGV.shift + unless /\Abison .* (\d+)\.\d+/ =~ IO.popen(ARGV+%w[--version], &:read) + puts colorize.fail("not bison") + exit + end + exit if $1.to_i >= 3 + ARGV.clear + ARGV.push(file) +} +$_.sub!(/^%define\s+api\.pure/, '%pure-parser') -- cgit v1.2.3