diff --git a/sample/calc-ja.y b/sample/calc-ja.y index 05f2137a..89c237de 100644 --- a/sample/calc-ja.y +++ b/sample/calc-ja.y @@ -26,7 +26,7 @@ end ---- header # ---- inner - + def evaluate(str) @tokens = [] until str.empty? diff --git a/sample/calc.y b/sample/calc.y index 8135731d..8b13131a 100644 --- a/sample/calc.y +++ b/sample/calc.y @@ -24,7 +24,7 @@ end ---- header # ---- inner - + def parse(str) @q = [] until str.empty? diff --git a/sample/hash.y b/sample/hash.y index 85348e4e..7cb6739d 100644 --- a/sample/hash.y +++ b/sample/hash.y @@ -7,7 +7,7 @@ class HashParser rule hash : '{' contents '}' { val[1] } | '{' '}' { Hash.new } - + # Racc can handle string over 2 bytes. contents: IDENT '=>' IDENT { {val[0] => val[2]} } | contents ',' IDENT '=>' IDENT { val[0][val[2]] = val[4]; val[0] } diff --git a/sample/syntax.y b/sample/syntax.y index dd4c6699..ca4cdf2d 100644 --- a/sample/syntax.y +++ b/sample/syntax.y @@ -28,7 +28,7 @@ rule print 'cba' } | cont - + cont : A c2 B c2 C c2 : C C C C C diff --git a/test/case.rb b/test/case.rb index f4240bfd..d917f3a4 100644 --- a/test/case.rb +++ b/test/case.rb @@ -90,8 +90,7 @@ def assert_output_unchanged(asset) actual = File.read("#{@TAB_DIR}/#{file}") result = (strip_version(expected) == strip_version(actual)) - assert(result, "Output of test/assets/#{file}.y differed from " \ - "expectation. Try compiling it and diff with test/regress/#{file}.") + assert(result, proc {`diff -u #{REGRESS_DIR}/#{file} #{@TAB_DIR}/#{file}`}) end def racc(*arg, **opt)