Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip trailing spaces #189

Merged
merged 2 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sample/calc-ja.y
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
---- header
#
---- inner

def evaluate(str)
@tokens = []
until str.empty?
Expand Down
2 changes: 1 addition & 1 deletion sample/calc.y
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
---- header
#
---- inner

def parse(str)
@q = []
until str.empty?
Expand Down
2 changes: 1 addition & 1 deletion sample/hash.y
Original file line number Diff line number Diff line change
Expand Up @@ -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] }
Expand Down
2 changes: 1 addition & 1 deletion sample/syntax.y
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rule
print 'cba'
}
| cont

cont : A c2 B c2 C

c2 : C C C C C
Expand Down
3 changes: 1 addition & 2 deletions test/case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down