From 56c5edfd2141145f2c3aa1f7010cf2e41a7e8662 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 27 Sep 2009 15:17:51 -0700 Subject: start_sequence implemented --- lib/psych.rb | 5 +++++ lib/psych/parser/handler.rb | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/psych.rb b/lib/psych.rb index a695b0a..812891e 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -19,6 +19,11 @@ module Psych LITERAL_SCALAR_STYLE = 4 FOLDED_SCALAR_STYLE = 5 + # Sequence Styles + ANY_SEQUENCE_STYLE = 0 + BLOCK_SEQUENCE_STYLE = 1 + FLOW_SEQUENCE_STYLE = 2 + def self.parse thing Psych::Parser.new.parse thing end diff --git a/lib/psych/parser/handler.rb b/lib/psych/parser/handler.rb index 9cb8281..b2706c1 100644 --- a/lib/psych/parser/handler.rb +++ b/lib/psych/parser/handler.rb @@ -27,7 +27,12 @@ module Psych ### # Called when a scalar +value+ is found. The scalar may have an # +anchor+, a +tag+, be implicitly +plain+ or implicitly +quoted+ - def scalar value, anchor = nil, tag = nil, plain = true, quoted = true, style = 0 + def scalar value, anchor = nil, tag = nil, plain = true, quoted = true, style = ANY_SCALAR_STYLE + end + + ### + # Called when a sequence is started. + def start_sequence anchor = nil, tag = nil, implicit = true, style = BLOCK_SEQUENCE_STYLE end ### -- cgit v1.2.3