Share

Kwalify

Tracker: Bugs

5 Kwalify::YAML can't parse map of sequences - ID: 2726441
Last Update: Comment added ( mikaelpahmp )

irb> Kwalify::Yaml.load({ 'foo' => [ 'bar', 'baz'] }.to_yaml)
Kwalify::SyntaxError: 3:1 [/] document end expected (maybe invalid tab char
found).

It seems Kwalify doesn't recognize '- ' as valid indentation - manually
entering a YAML-string where
the sequence is indented with spaces before the dash makes it parse just
fine.


Kenneth Vestergaard Schmidt ( kvs ) - 2009-04-02 09:19

5

Open

None

Kuwata Makoto

kwalify

None

Public


Comment ( 1 )




Date: 2009-11-09 13:37
Sender: mikaelpahmp

I've made a fix for this problem. Not thorough testing but seems to work.

--- D:/sdk/kwalify-0.7.1/lib/kwalify/parser/yaml.rb Mon Jan 28 08:57:46
2008
+++
c:/Ruby/lib/ruby/gems/1.8/gems/kwalify-0.7.1/lib/kwalify/parser/yaml.rb Mon
Nov 09 14:14:50 2009
@@ -233,11 +233,11 @@


def parse_block_value(level, rule, path, uniq_table, container)
skip_spaces_and_comments()
## nil
- return nil if @column <= level || eos?
+ return nil if @column < level || (@column == level &&
!match?(/-\s+/)) || eos?
## anchor and alias
name = nil
if scan(/\&([-\w]+)/)
name = parse_anchor(rule, path, uniq_table, container)
elsif scan(/\*([-\w]+)/)



Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.