kwalify 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +15 -4
- data/README.txt +8 -10
- data/bin/kwalify +1 -1
- data/contrib/inline-require +1 -1
- data/contrib/kwalify +47 -30
- data/doc-api/classes/CommandOptionError.html +1 -1
- data/doc-api/classes/Kwalify.html +1 -1
- data/doc-api/classes/Kwalify/BaseError.html +1 -1
- data/doc-api/classes/Kwalify/Validator.html +4 -1
- data/doc-api/classes/Kwalify/Yaml.html +26 -13
- data/doc-api/classes/Kwalify/Yaml/Parser.html +17 -17
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +9 -11
- data/doc-api/files/kwalify/errors_rb.html +2 -2
- data/doc-api/files/kwalify/main_rb.html +1 -1
- data/doc-api/files/kwalify/messages_rb.html +2 -2
- data/doc-api/files/kwalify/meta-validator_rb.html +1 -1
- data/doc-api/files/kwalify/parser/base_rb.html +1 -1
- data/doc-api/files/kwalify/parser/yaml_rb.html +2 -2
- data/doc-api/files/kwalify/rule_rb.html +1 -1
- data/doc-api/files/kwalify/types_rb.html +1 -1
- data/doc-api/files/kwalify/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwalify/util/hash-interface_rb.html +1 -1
- data/doc-api/files/kwalify/util/hashlike_rb.html +1 -1
- data/doc-api/files/kwalify/util/option-parser_rb.html +1 -1
- data/doc-api/files/kwalify/util/ordered-hash_rb.html +1 -1
- data/doc-api/files/kwalify/util/testcase-helper_rb.html +1 -1
- data/doc-api/files/kwalify/util_rb.html +1 -1
- data/doc-api/files/kwalify/validator_rb.html +2 -2
- data/doc-api/files/kwalify/yaml-parser_rb.html +1 -1
- data/doc-api/files/kwalify_rb.html +2 -2
- data/doc/users-guide.html +20 -15
- data/examples/address-book/address-book.schema.yaml +1 -1
- data/examples/invoice/invoice.schema.yaml +1 -1
- data/examples/tapkit/tapkit.schema.yaml +1 -1
- data/lib/kwalify.rb +22 -12
- data/lib/kwalify/errors.rb +3 -3
- data/lib/kwalify/main.rb +1 -1
- data/lib/kwalify/messages.rb +1 -1
- data/lib/kwalify/meta-validator.rb +1 -1
- data/lib/kwalify/parser/base.rb +1 -1
- data/lib/kwalify/parser/yaml.rb +7 -3
- data/lib/kwalify/rule.rb +1 -1
- data/lib/kwalify/templates/genclass-java.eruby +1 -1
- data/lib/kwalify/templates/genclass-php.eruby +1 -1
- data/lib/kwalify/templates/genclass-ruby.eruby +1 -1
- data/lib/kwalify/types.rb +1 -1
- data/lib/kwalify/util.rb +1 -1
- data/lib/kwalify/util/assert-text-equal.rb +1 -1
- data/lib/kwalify/util/hash-interface.rb +1 -1
- data/lib/kwalify/util/hashlike.rb +1 -1
- data/lib/kwalify/util/option-parser.rb +1 -1
- data/lib/kwalify/util/ordered-hash.rb +1 -1
- data/lib/kwalify/util/testcase-helper.rb +1 -1
- data/lib/kwalify/validator.rb +5 -2
- data/lib/kwalify/yaml-parser.rb +1 -1
- data/test/data/users-guide/answers-validator.rb +9 -9
- data/test/data/users-guide/howto-validation.rb +2 -2
- data/test/data/users-guide/invalid07.result +1 -1
- data/test/data/users-guide/loadconfig.rb +2 -1
- data/test/data/users-guide/loadconfig.result +5 -1
- data/test/test-action.rb +1 -1
- data/test/test-action.yaml +1 -1
- data/test/test-databinding.rb +6 -3
- data/test/test-databinding.yaml +39 -1
- data/test/test-main.rb +1 -1
- data/test/test-main.yaml +1 -1
- data/test/test-metavalidator.rb +1 -1
- data/test/test-metavalidator.yaml +1 -1
- data/test/test-parser-yaml.rb +1 -1
- data/test/test-parser-yaml.yaml +1 -1
- data/test/test-rule.rb +1 -1
- data/test/test-rule.yaml +1 -1
- data/test/test-validator.rb +1 -1
- data/test/test-validator.yaml +1 -1
- data/test/test-yaml-parser.rb +1 -1
- data/test/test-yaml-parser.yaml +1 -1
- data/test/test.rb +1 -1
- metadata +2 -2
data/CHANGES.txt
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
.=title: ChangeLog
|
2
|
-
.?release: $Release: 0.7.
|
3
|
-
.?lastupdate: $Date: 2008-01-
|
4
|
-
.?version: $Rev:
|
2
|
+
.?release: $Release: 0.7.1 $
|
3
|
+
.?lastupdate: $Date: 2008-01-28 15:27:12 +0900 (Mon, 28 Jan 2008) $
|
4
|
+
.?version: $Rev: 99 $
|
5
|
+
|
6
|
+
|
7
|
+
.: Release 0.7.1 (2008-01-28)
|
8
|
+
|
9
|
+
.* bugfix:
|
10
|
+
|
11
|
+
.- 'Duplicated key' error is now not raised if corresponding rule
|
12
|
+
has 'default:' constraint.
|
13
|
+
|
14
|
+
.- Path is now copied in Kwalify::ValidationError#initialize()
|
15
|
+
|
5
16
|
|
6
17
|
.: Release 0.7.0 (2008-01-27)
|
7
18
|
|
@@ -115,7 +126,7 @@
|
|
115
126
|
|
116
127
|
.- Action 'genclass-ruby' supports '--hashlike' property.
|
117
128
|
|
118
|
-
.- Action 'genclass-ruby' supports '--
|
129
|
+
.- Action 'genclass-ruby' supports '--initialize=false' property.
|
119
130
|
|
120
131
|
.- Add action 'geclass-php'
|
121
132
|
|
data/README.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= README
|
2
2
|
|
3
|
-
release:: 0.7.
|
4
|
-
lastupdate:: $Date: 2008-01-
|
3
|
+
release:: 0.7.1
|
4
|
+
lastupdate:: $Date: 2008-01-28 15:27:12 +0900 (Mon, 28 Jan 2008) $
|
5
5
|
copyright:: copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
6
6
|
|
7
7
|
|
@@ -23,16 +23,14 @@ If you have installed RubyGems, just type 'gem install kwalify'
|
|
23
23
|
|
24
24
|
Else if you can be root user, use 'setup.rb' as following:
|
25
25
|
|
26
|
-
$ tar xjf
|
27
|
-
$ cd
|
28
|
-
$ ruby setup.rb config
|
29
|
-
$ ruby setup.rb setup
|
26
|
+
$ tar xjf kwalify-0.7.1.tar.bz2
|
27
|
+
$ cd kwalify-0.7.1/
|
30
28
|
$ sudo ruby setup.rb install
|
31
29
|
|
32
30
|
Else copy script and libraries to proper directory.
|
33
31
|
|
34
|
-
$ tar xjf
|
35
|
-
$ cd
|
32
|
+
$ tar xjf kwalify-0.7.1.tar.bz2
|
33
|
+
$ cd kwalify-0.7.1/
|
36
34
|
$ mkdir -p $HOME/bin
|
37
35
|
$ cp -a bin/* $HOME/bin
|
38
36
|
$ export PATH=$PATH:$HOME/bin
|
@@ -43,8 +41,8 @@ Else copy script and libraries to proper directory.
|
|
43
41
|
(Optional) 'contrib/inline-require' script to concatenate all script
|
44
42
|
and libraries into a file.
|
45
43
|
|
46
|
-
$ tar xjf
|
47
|
-
$ cd
|
44
|
+
$ tar xjf kwalify-0.7.1.tar.bz2
|
45
|
+
$ cd kwalify-0.7.1/
|
48
46
|
$ unset RUBYLIB
|
49
47
|
$ ruby contrib/inline-require -I ./lib bin/kwalify > contrib/kwalify
|
50
48
|
$ chmod a+x contrib/kwalify
|
data/bin/kwalify
CHANGED
data/contrib/inline-require
CHANGED
data/contrib/kwalify
CHANGED
@@ -2,28 +2,28 @@
|
|
2
2
|
|
3
3
|
###
|
4
4
|
### $Rev: 83 $
|
5
|
-
### $Release: 0.7.
|
5
|
+
### $Release: 0.7.1 $
|
6
6
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
7
7
|
###
|
8
8
|
|
9
9
|
#--begin of require 'kwalify'
|
10
10
|
###
|
11
|
-
### $Rev:
|
12
|
-
### $Release: 0.7.
|
11
|
+
### $Rev: 99 $
|
12
|
+
### $Release: 0.7.1 $
|
13
13
|
### copyright(c) 2006 kuwata-lab.com all rights reserved.
|
14
14
|
###
|
15
15
|
|
16
16
|
|
17
17
|
module Kwalify
|
18
18
|
|
19
|
-
RELEASE = ("$Release: 0.7.
|
19
|
+
RELEASE = ("$Release: 0.7.1 $" =~ /[.\d]+/) && $&
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
23
|
#--begin of require 'kwalify/types'
|
24
24
|
###
|
25
25
|
### $Rev: 87 $
|
26
|
-
### $Release: 0.7.
|
26
|
+
### $Release: 0.7.1 $
|
27
27
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
28
28
|
###
|
29
29
|
|
@@ -181,7 +181,7 @@ end
|
|
181
181
|
#--begin of require 'kwalify/messages'
|
182
182
|
###
|
183
183
|
### $Rev: 95 $
|
184
|
-
### $Release: 0.7.
|
184
|
+
### $Release: 0.7.1 $
|
185
185
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
186
186
|
###
|
187
187
|
|
@@ -355,8 +355,8 @@ end
|
|
355
355
|
#--end of require 'kwalify/messages'
|
356
356
|
#--begin of require 'kwalify/errors'
|
357
357
|
###
|
358
|
-
### $Rev:
|
359
|
-
### $Release: 0.7.
|
358
|
+
### $Rev: 99 $
|
359
|
+
### $Release: 0.7.1 $
|
360
360
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
361
361
|
###
|
362
362
|
|
@@ -378,7 +378,7 @@ module Kwalify
|
|
378
378
|
class BaseError < KwalifyError
|
379
379
|
def initialize(message="", path=nil, value=nil, rule=nil, error_symbol=nil)
|
380
380
|
super(message)
|
381
|
-
@path = path
|
381
|
+
@path = path.is_a?(Array) ? '/'+path.join('/') : path
|
382
382
|
@rule = rule
|
383
383
|
@value = value
|
384
384
|
@error_symbol = error_symbol
|
@@ -485,7 +485,7 @@ end
|
|
485
485
|
#--begin of require 'kwalify/rule'
|
486
486
|
###
|
487
487
|
### $Rev: 95 $
|
488
|
-
### $Release: 0.7.
|
488
|
+
### $Release: 0.7.1 $
|
489
489
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
490
490
|
###
|
491
491
|
|
@@ -1045,8 +1045,8 @@ end
|
|
1045
1045
|
#--end of require 'kwalify/rule'
|
1046
1046
|
#--begin of require 'kwalify/validator'
|
1047
1047
|
###
|
1048
|
-
### $Rev:
|
1049
|
-
### $Release: 0.7.
|
1048
|
+
### $Rev: 99 $
|
1049
|
+
### $Release: 0.7.1 $
|
1050
1050
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
1051
1051
|
###
|
1052
1052
|
|
@@ -1159,6 +1159,9 @@ module Kwalify
|
|
1159
1159
|
end
|
1160
1160
|
return unless errors.length == n
|
1161
1161
|
#
|
1162
|
+
#path_str = path.is_a?(Array) ? '/'+path.join('/') : path
|
1163
|
+
#validate_hook(value, rule, path_str, errors)
|
1164
|
+
#@block.call(value, rule, path_str, errors) if @block
|
1162
1165
|
validate_hook(value, rule, path, errors)
|
1163
1166
|
@block.call(value, rule, path, errors) if @block
|
1164
1167
|
end
|
@@ -1327,7 +1330,7 @@ end
|
|
1327
1330
|
#--begin of require 'kwalify/meta-validator'
|
1328
1331
|
###
|
1329
1332
|
### $Rev: 95 $
|
1330
|
-
### $Release: 0.7.
|
1333
|
+
### $Release: 0.7.1 $
|
1331
1334
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
1332
1335
|
###
|
1333
1336
|
|
@@ -1336,8 +1339,8 @@ end
|
|
1336
1339
|
#--already included require 'kwalify/validator'
|
1337
1340
|
#--begin of require 'kwalify/parser/yaml'
|
1338
1341
|
###
|
1339
|
-
### $Rev:
|
1340
|
-
### $Release: 0.7.
|
1342
|
+
### $Rev: 99 $
|
1343
|
+
### $Release: 0.7.1 $
|
1341
1344
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
1342
1345
|
###
|
1343
1346
|
|
@@ -1346,7 +1349,7 @@ end
|
|
1346
1349
|
#--begin of require 'kwalify/util'
|
1347
1350
|
###
|
1348
1351
|
### $Rev: 88 $
|
1349
|
-
### $Release: 0.7.
|
1352
|
+
### $Release: 0.7.1 $
|
1350
1353
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
1351
1354
|
###
|
1352
1355
|
|
@@ -1505,7 +1508,7 @@ end
|
|
1505
1508
|
#--begin of require 'kwalify/parser/base'
|
1506
1509
|
###
|
1507
1510
|
### $Rev: 92 $
|
1508
|
-
### $Release: 0.7.
|
1511
|
+
### $Release: 0.7.1 $
|
1509
1512
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
1510
1513
|
###
|
1511
1514
|
|
@@ -1959,8 +1962,12 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
1959
1962
|
_linenum, _column, _linenum2, _column2) #:nodoc:
|
1960
1963
|
key = to_mapkey(key)
|
1961
1964
|
path[-1] = key
|
1965
|
+
#if map.is_a?(Hash) && map.key?(key) && !is_merged
|
1962
1966
|
if map.respond_to?('key?') && map.key?(key) && !is_merged
|
1963
|
-
|
1967
|
+
rule = map_rule.mapping[key]
|
1968
|
+
unless rule && rule.default
|
1969
|
+
raise _syntax_error("mapping key is duplicated.", path)
|
1970
|
+
end
|
1964
1971
|
end
|
1965
1972
|
#
|
1966
1973
|
if key == '=' # default
|
@@ -2728,7 +2735,7 @@ end
|
|
2728
2735
|
#--begin of require 'kwalify/yaml-parser'
|
2729
2736
|
###
|
2730
2737
|
### $Rev: 81 $
|
2731
|
-
### $Release: 0.7.
|
2738
|
+
### $Release: 0.7.1 $
|
2732
2739
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
2733
2740
|
###
|
2734
2741
|
|
@@ -3613,19 +3620,29 @@ module Kwalify
|
|
3613
3620
|
|
3614
3621
|
autoload :Parser, 'kwalify/parser/yaml'
|
3615
3622
|
|
3616
|
-
|
3623
|
+
## read yaml_str, parse it, and return yaml document.
|
3624
|
+
##
|
3625
|
+
## opts:
|
3626
|
+
## ::validator: Kwalify::Validator object
|
3627
|
+
## ::preceding_aliass: allow preceding alias if true
|
3628
|
+
## ::data_binding: enable data binding if true
|
3629
|
+
## ::untabify: expand tab chars if true
|
3630
|
+
## ::filename: filename
|
3631
|
+
def self.load(yaml_str, opts={})
|
3617
3632
|
#require 'kwalify/parser/yaml'
|
3618
|
-
parser = Kwalify::Yaml::Parser.new
|
3619
|
-
parser.preceding_alias = true if
|
3620
|
-
parser.data_binding = true if
|
3621
|
-
yaml_str = Kwalify::Util.untabify(yaml_str) if
|
3622
|
-
ydoc = parser.parse(yaml_str, :filename=>
|
3633
|
+
parser = Kwalify::Yaml::Parser.new(opts[:validator])
|
3634
|
+
parser.preceding_alias = true if opts[:preceding_alias]
|
3635
|
+
parser.data_binding = true if opts[:data_binding]
|
3636
|
+
yaml_str = Kwalify::Util.untabify(yaml_str) if opts[:untabify]
|
3637
|
+
ydoc = parser.parse(yaml_str, :filename=>opts[:filename])
|
3623
3638
|
return ydoc
|
3624
3639
|
end
|
3625
3640
|
|
3626
|
-
|
3627
|
-
|
3628
|
-
|
3641
|
+
## read file, parse it, and return yaml document.
|
3642
|
+
## see Kwalify::Yaml::Parser.load()
|
3643
|
+
def self.load_file(filename, opts={})
|
3644
|
+
opts[:filename] = filename
|
3645
|
+
return self.load(File.read(filename), opts)
|
3629
3646
|
end
|
3630
3647
|
|
3631
3648
|
end
|
@@ -3638,7 +3655,7 @@ end
|
|
3638
3655
|
#--begin of require 'kwalify/main'
|
3639
3656
|
###
|
3640
3657
|
### $Rev: 95 $
|
3641
|
-
### $Release: 0.7.
|
3658
|
+
### $Release: 0.7.1 $
|
3642
3659
|
### copyright(c) 2005-2008 kuwata-lab all rights reserved.
|
3643
3660
|
###
|
3644
3661
|
|
@@ -3649,7 +3666,7 @@ require 'erb'
|
|
3649
3666
|
#--begin of require 'kwalify/util/ordered-hash'
|
3650
3667
|
###
|
3651
3668
|
### $Rev: 84 $
|
3652
|
-
### 0.7.
|
3669
|
+
### 0.7.1
|
3653
3670
|
### $COPYRIGHT$
|
3654
3671
|
###
|
3655
3672
|
|
@@ -193,7 +193,7 @@ Class <a href="Kwalify/YamlSyntaxError.html" class="link">Kwalify::YamlSyntaxErr
|
|
193
193
|
<tr class="top-aligned-row context-row">
|
194
194
|
<td class="context-item-name">RELEASE</td>
|
195
195
|
<td>=</td>
|
196
|
-
<td class="context-item-value">("$Release: 0.7.
|
196
|
+
<td class="context-item-value">("$Release: 0.7.1 $" =~ /[.\d]+/) && $&</td>
|
197
197
|
</tr>
|
198
198
|
</table>
|
199
199
|
</div>
|
@@ -191,7 +191,7 @@
|
|
191
191
|
<span class="ruby-comment cmt"># File kwalify/errors.rb, line 23</span>
|
192
192
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>=<span class="ruby-value str">""</span>, <span class="ruby-identifier">path</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">rule</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">error_symbol</span>=<span class="ruby-keyword kw">nil</span>)
|
193
193
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
|
194
|
-
<span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>
|
194
|
+
<span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">'/'</span><span class="ruby-operator">+</span><span class="ruby-identifier">path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">path</span>
|
195
195
|
<span class="ruby-ivar">@rule</span> = <span class="ruby-identifier">rule</span>
|
196
196
|
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span>
|
197
197
|
<span class="ruby-ivar">@error_symbol</span> = <span class="ruby-identifier">error_symbol</span>
|
@@ -274,6 +274,9 @@ ex2. <a href="Validator.html#M000076">validate</a> with parsing
|
|
274
274
|
<span class="ruby-keyword kw">end</span>
|
275
275
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">errors</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">n</span>
|
276
276
|
<span class="ruby-comment cmt">#</span>
|
277
|
+
<span class="ruby-comment cmt">#path_str = path.is_a?(Array) ? '/'+path.join('/') : path</span>
|
278
|
+
<span class="ruby-comment cmt">#validate_hook(value, rule, path_str, errors)</span>
|
279
|
+
<span class="ruby-comment cmt">#@block.call(value, rule, path_str, errors) if @block</span>
|
277
280
|
<span class="ruby-identifier">validate_hook</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">errors</span>)
|
278
281
|
<span class="ruby-ivar">@block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">errors</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@block</span>
|
279
282
|
<span class="ruby-keyword kw">end</span>
|
@@ -296,7 +299,7 @@ ex2. <a href="Validator.html#M000076">validate</a> with parsing
|
|
296
299
|
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
297
300
|
<div class="method-source-code" id="M000079-source">
|
298
301
|
<pre>
|
299
|
-
<span class="ruby-comment cmt"># File kwalify/validator.rb, line
|
302
|
+
<span class="ruby-comment cmt"># File kwalify/validator.rb, line 188</span>
|
300
303
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_validate_unique</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">errors</span>, <span class="ruby-identifier">uniq_table</span>)
|
301
304
|
<span class="ruby-identifier">assert_error</span> <span class="ruby-node">"uniq_table=#{uniq_table.inspect}"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">rule</span>.<span class="ruby-identifier">unique</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">rule</span>.<span class="ruby-identifier">ident</span>
|
302
305
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uniq_table</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">value</span>)
|
@@ -118,23 +118,32 @@
|
|
118
118
|
|
119
119
|
<div class="method-heading">
|
120
120
|
<a href="#M000038" class="method-signature">
|
121
|
-
<span class="method-name">load</span><span class="method-args">(yaml_str,
|
121
|
+
<span class="method-name">load</span><span class="method-args">(yaml_str, opts={})</span>
|
122
122
|
</a>
|
123
123
|
</div>
|
124
124
|
|
125
125
|
<div class="method-description">
|
126
|
+
<p>
|
127
|
+
read yaml_str, parse it, and return yaml document.
|
128
|
+
</p>
|
129
|
+
<p>
|
130
|
+
opts: ::validator: <a href="Validator.html">Kwalify::Validator</a> object
|
131
|
+
::preceding_aliass: allow preceding alias if true ::data_binding: enable
|
132
|
+
data binding if true ::untabify: expand tab chars if true ::filename:
|
133
|
+
filename
|
134
|
+
</p>
|
126
135
|
<p><a class="source-toggle" href="#"
|
127
136
|
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
128
137
|
<div class="method-source-code" id="M000038-source">
|
129
138
|
<pre>
|
130
|
-
<span class="ruby-comment cmt"># File kwalify.rb, line
|
131
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">yaml_str</span>, <span class="ruby-identifier">
|
139
|
+
<span class="ruby-comment cmt"># File kwalify.rb, line 45</span>
|
140
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">yaml_str</span>, <span class="ruby-identifier">opts</span>={})
|
132
141
|
<span class="ruby-comment cmt">#require 'kwalify/parser/yaml'</span>
|
133
|
-
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">Kwalify</span><span class="ruby-operator">::</span><span class="ruby-constant">Yaml</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">new</span>
|
134
|
-
<span class="ruby-identifier">parser</span>.<span class="ruby-identifier">preceding_alias</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">
|
135
|
-
<span class="ruby-identifier">parser</span>.<span class="ruby-identifier">data_binding</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">
|
136
|
-
<span class="ruby-identifier">yaml_str</span> = <span class="ruby-constant">Kwalify</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">untabify</span>(<span class="ruby-identifier">yaml_str</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">
|
137
|
-
<span class="ruby-identifier">ydoc</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">yaml_str</span>, <span class="ruby-identifier">:filename=</span><span class="ruby-operator">></span><span class="ruby-identifier">
|
142
|
+
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">Kwalify</span><span class="ruby-operator">::</span><span class="ruby-constant">Yaml</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:validator</span>])
|
143
|
+
<span class="ruby-identifier">parser</span>.<span class="ruby-identifier">preceding_alias</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:preceding_alias</span>]
|
144
|
+
<span class="ruby-identifier">parser</span>.<span class="ruby-identifier">data_binding</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:data_binding</span>]
|
145
|
+
<span class="ruby-identifier">yaml_str</span> = <span class="ruby-constant">Kwalify</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">untabify</span>(<span class="ruby-identifier">yaml_str</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:untabify</span>]
|
146
|
+
<span class="ruby-identifier">ydoc</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">yaml_str</span>, <span class="ruby-identifier">:filename=</span><span class="ruby-operator">></span><span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:filename</span>])
|
138
147
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ydoc</span>
|
139
148
|
<span class="ruby-keyword kw">end</span>
|
140
149
|
</pre>
|
@@ -147,19 +156,23 @@
|
|
147
156
|
|
148
157
|
<div class="method-heading">
|
149
158
|
<a href="#M000039" class="method-signature">
|
150
|
-
<span class="method-name">load_file</span><span class="method-args">(filename,
|
159
|
+
<span class="method-name">load_file</span><span class="method-args">(filename, opts={})</span>
|
151
160
|
</a>
|
152
161
|
</div>
|
153
162
|
|
154
163
|
<div class="method-description">
|
164
|
+
<p>
|
165
|
+
read file, parse it, and return yaml document. see
|
166
|
+
Kwalify::Yaml::Parser.load()
|
167
|
+
</p>
|
155
168
|
<p><a class="source-toggle" href="#"
|
156
169
|
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
157
170
|
<div class="method-source-code" id="M000039-source">
|
158
171
|
<pre>
|
159
|
-
<span class="ruby-comment cmt"># File kwalify.rb, line
|
160
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">
|
161
|
-
<span class="ruby-identifier">
|
162
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>), <span class="ruby-identifier">
|
172
|
+
<span class="ruby-comment cmt"># File kwalify.rb, line 57</span>
|
173
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">opts</span>={})
|
174
|
+
<span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:filename</span>] = <span class="ruby-identifier">filename</span>
|
175
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>), <span class="ruby-identifier">opts</span>)
|
163
176
|
<span class="ruby-keyword kw">end</span>
|
164
177
|
</pre>
|
165
178
|
</div>
|
@@ -316,7 +316,7 @@ end private :_validate_error
|
|
316
316
|
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
317
317
|
<div class="method-source-code" id="M000057-source">
|
318
318
|
<pre>
|
319
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
319
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 408</span>
|
320
320
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_validate_map_value</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">map_rule</span>, <span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-comment cmt">#*V</span>
|
321
321
|
<span class="ruby-identifier">_linenum</span>, <span class="ruby-identifier">_column</span>) <span class="ruby-comment cmt">#*V</span>
|
322
322
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">map_rule</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">rule</span> <span class="ruby-comment cmt">#*V</span>
|
@@ -398,7 +398,7 @@ end private :_validate_error
|
|
398
398
|
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
399
399
|
<div class="method-source-code" id="M000072-source">
|
400
400
|
<pre>
|
401
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
401
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 795</span>
|
402
402
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">location</span>(<span class="ruby-identifier">path</span>)
|
403
403
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span>
|
404
404
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@location_table</span>[<span class="ruby-value">-1</span>] <span class="ruby-comment cmt"># return value is [linenum, column]</span>
|
@@ -543,7 +543,7 @@ end private :_validate_error
|
|
543
543
|
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
544
544
|
<div class="method-source-code" id="M000058-source">
|
545
545
|
<pre>
|
546
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
546
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 426</span>
|
547
547
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_block_map</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">map_rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>)
|
548
548
|
<span class="ruby-identifier">_start_linenum</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-comment cmt">#*V</span>
|
549
549
|
<span class="ruby-identifier">_start_column</span> = <span class="ruby-ivar">@column</span> <span class="ruby-comment cmt">#*V</span>
|
@@ -588,7 +588,7 @@ end private :_validate_error
|
|
588
588
|
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
589
589
|
<div class="method-source-code" id="M000059-source">
|
590
590
|
<pre>
|
591
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
591
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 463</span>
|
592
592
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_block_scalar</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>)
|
593
593
|
<span class="ruby-identifier">_linenum</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-comment cmt">#*V</span>
|
594
594
|
<span class="ruby-identifier">_column</span> = <span class="ruby-ivar">@column</span> <span class="ruby-comment cmt">#*V</span>
|
@@ -673,7 +673,7 @@ end private :_validate_error
|
|
673
673
|
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
674
674
|
<div class="method-source-code" id="M000060-source">
|
675
675
|
<pre>
|
676
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
676
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 484</span>
|
677
677
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_block_text</span>(<span class="ruby-identifier">column</span>, <span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>)
|
678
678
|
<span class="ruby-identifier">_linenum</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-comment cmt">#*V</span>
|
679
679
|
<span class="ruby-identifier">_column</span> = <span class="ruby-ivar">@column</span> <span class="ruby-comment cmt">#*V</span>
|
@@ -890,7 +890,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
890
890
|
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
891
891
|
<div class="method-source-code" id="M000063-source">
|
892
892
|
<pre>
|
893
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
893
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 634</span>
|
894
894
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_flow_map</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">map_rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>)
|
895
895
|
<span class="ruby-comment cmt">#scan(/\{\s*/) # not work?</span>
|
896
896
|
<span class="ruby-identifier">_start_linenum</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-comment cmt">#*V</span>
|
@@ -947,7 +947,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
947
947
|
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
948
948
|
<div class="method-source-code" id="M000064-source">
|
949
949
|
<pre>
|
950
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
950
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 673</span>
|
951
951
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_flow_scalar</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>)
|
952
952
|
<span class="ruby-identifier">ch</span> = <span class="ruby-identifier">peep</span>(<span class="ruby-value">1</span>)
|
953
953
|
<span class="ruby-identifier">_linenum</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-comment cmt">#*V</span>
|
@@ -991,7 +991,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
991
991
|
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
992
992
|
<div class="method-source-code" id="M000062-source">
|
993
993
|
<pre>
|
994
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
994
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 597</span>
|
995
995
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_flow_seq</span>(<span class="ruby-identifier">seq</span>, <span class="ruby-identifier">seq_rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>)
|
996
996
|
<span class="ruby-comment cmt">#scan(/\[\s*/)</span>
|
997
997
|
<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/\[/</span>)
|
@@ -1046,7 +1046,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1046
1046
|
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
1047
1047
|
<div class="method-source-code" id="M000061-source">
|
1048
1048
|
<pre>
|
1049
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1049
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 555</span>
|
1050
1050
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_flow_value</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">uniq_table</span>, <span class="ruby-identifier">container</span>)
|
1051
1051
|
<span class="ruby-identifier">skip_spaces_and_comments</span>()
|
1052
1052
|
<span class="ruby-comment cmt">## anchor and alias</span>
|
@@ -1249,7 +1249,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1249
1249
|
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
1250
1250
|
<div class="method-source-code" id="M000073-source">
|
1251
1251
|
<pre>
|
1252
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1252
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 834</span>
|
1253
1253
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_errors_linenum</span>(<span class="ruby-identifier">errors</span>)
|
1254
1254
|
<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">error</span><span class="ruby-operator">|</span>
|
1255
1255
|
<span class="ruby-identifier">error</span>.<span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">error</span>.<span class="ruby-identifier">column</span> = <span class="ruby-identifier">location</span>(<span class="ruby-identifier">error</span>.<span class="ruby-identifier">path</span>)
|
@@ -1324,7 +1324,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1324
1324
|
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
1325
1325
|
<div class="method-source-code" id="M000065-source">
|
1326
1326
|
<pre>
|
1327
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1327
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 702</span>
|
1328
1328
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_scalar</span>(<span class="ruby-identifier">str</span>)
|
1329
1329
|
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">str</span>
|
1330
1330
|
<span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span> ; <span class="ruby-identifier">val</span> = <span class="ruby-keyword kw">nil</span>
|
@@ -1373,7 +1373,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1373
1373
|
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
1374
1374
|
<div class="method-source-code" id="M000071-source">
|
1375
1375
|
<pre>
|
1376
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1376
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 783</span>
|
1377
1377
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_getclass</span>(<span class="ruby-identifier">classname</span>)
|
1378
1378
|
<span class="ruby-identifier">mod</span> = <span class="ruby-constant">Object</span>
|
1379
1379
|
<span class="ruby-identifier">classname</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/::/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">modname</span><span class="ruby-operator">|</span>
|
@@ -1400,7 +1400,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1400
1400
|
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
1401
1401
|
<div class="method-source-code" id="M000069-source">
|
1402
1402
|
<pre>
|
1403
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1403
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 762</span>
|
1404
1404
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_to_seq</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">seq</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
1405
1405
|
<span class="ruby-identifier">seq</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">val</span>
|
1406
1406
|
<span class="ruby-ivar">@location_table</span>[<span class="ruby-identifier">seq</span>.<span class="ruby-identifier">__id__</span>] <span class="ruby-operator"><<</span> [<span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>]
|
@@ -1424,7 +1424,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1424
1424
|
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
1425
1425
|
<div class="method-source-code" id="M000067-source">
|
1426
1426
|
<pre>
|
1427
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1427
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 743</span>
|
1428
1428
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_mapping</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
1429
1429
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rule</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">rule</span>.<span class="ruby-identifier">classobj</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@data_binding</span>
|
1430
1430
|
<span class="ruby-identifier">classobj</span> = <span class="ruby-identifier">rule</span>.<span class="ruby-identifier">classobj</span>
|
@@ -1456,7 +1456,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1456
1456
|
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
1457
1457
|
<div class="method-source-code" id="M000068-source">
|
1458
1458
|
<pre>
|
1459
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1459
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 757</span>
|
1460
1460
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_scalar</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
1461
1461
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span>
|
1462
1462
|
<span class="ruby-keyword kw">end</span>
|
@@ -1479,7 +1479,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1479
1479
|
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
1480
1480
|
<div class="method-source-code" id="M000066-source">
|
1481
1481
|
<pre>
|
1482
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1482
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 736</span>
|
1483
1483
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_sequence</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
1484
1484
|
<span class="ruby-identifier">seq</span> = <span class="ruby-ivar">@sequence_class</span>.<span class="ruby-identifier">new</span>
|
1485
1485
|
<span class="ruby-ivar">@location_table</span>[<span class="ruby-identifier">seq</span>.<span class="ruby-identifier">__id__</span>] = []
|
@@ -1504,7 +1504,7 @@ Alias for <a href="Parser.html#M000050">parse_stream</a>
|
|
1504
1504
|
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
1505
1505
|
<div class="method-source-code" id="M000070-source">
|
1506
1506
|
<pre>
|
1507
|
-
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line
|
1507
|
+
<span class="ruby-comment cmt"># File kwalify/parser/yaml.rb, line 768</span>
|
1508
1508
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_to_map</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
1509
1509
|
<span class="ruby-comment cmt">#if map.is_a?(Hash)</span>
|
1510
1510
|
<span class="ruby-comment cmt"># map[key] = val</span>
|