Created
February 3, 2016 15:07
-
-
Save mvidner/d1c803083dd6b156fb7b to your computer and use it in GitHub Desktop.
generate a file that will not parse with parser-2.3.0.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# parser-2.3.0.2 fails with fatal: unterminated string meets end of file | |
# ruby makebigfile.rb && ruby bigfile.rb && bundle exec ruby-parse --23 bigfile.rb | |
SIZE = 14500 | |
header = <<EOS | |
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# stub | |
def recursive(*args) | |
args | |
end | |
puts 'A big widget tree (#{SIZE})' | |
recursive( | |
[ | |
EOS | |
body = <<EOS | |
recursive(recursive("foo"), recursive(:bar, "baz"), "qux"), | |
EOS | |
footer = <<EOS | |
] | |
) | |
puts "Done" | |
EOS | |
File.write("bigfile.rb", header + body * SIZE + footer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment