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

parsing breaks on multi-line strings #54

Open
RichMorin opened this issue Aug 12, 2019 · 2 comments
Open

parsing breaks on multi-line strings #54

RichMorin opened this issue Aug 12, 2019 · 2 comments

Comments

@RichMorin
Copy link

RichMorin commented Aug 12, 2019

This gem is breaking for me when I try to parse a multi-line string. For example:

irb(main):020:0> text = <<EOT
irb(main):021:0" [foo]
irb(main):022:0" 
irb(main):023:0"   bar = '''
irb(main):024:0" baz
irb(main):025:0" '''
irb(main):026:0" EOT
=> "[foo]\n\n  bar = '''\nbaz\n'''\n"
irb(main):027:0> TOML.load(text)
NoMethodError: undefined method `ascii_tree' for nil:NilClass
from /Library/Ruby/Gems/2.3.0/gems/toml-0.2.0/lib/toml/parser.rb:12:in
      `rescue in initialize'
from /Library/Ruby/Gems/2.3.0/gems/toml-0.2.0/lib/toml/parser.rb:9:in `initialize'
from /Library/Ruby/Gems/2.3.0/gems/toml-0.2.0/lib/toml.rb:19:in `new'
from /Library/Ruby/Gems/2.3.0/gems/toml-0.2.0/lib/toml.rb:19:in `load'
from (irb):27
from /usr/bin/irb:11:in `<main>'

The problem occurs with either ''' or """ strings and with both load and load_file.
Here is some environment info:

$ gem list | grep toml
toml (0.2.0)
$ ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
@mkarklinsScout
Copy link

@RichMorin did you ever solve the problem?

@RichMorin
Copy link
Author

no, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants