modl 0.3.27 → 0.3.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/modl/parser/parser.rb +10 -2
- data/lib/modl/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f38dca1aa60310b7fab61c2903d9f5a8aef61b16b3e75fc2820e9c4bcd874680
|
4
|
+
data.tar.gz: 3f139db340886f4ecaff8633178bee2f81de07d628e4b660ba3c9a81570681d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22aa26fe242cbef6c107a0d11108a1b55eb1db8a3846f846de336102be16c85c7e658614a218dc5dba5c10b087e3937d769f634590a0a1c5f413fa6e0825ea63
|
7
|
+
data.tar.gz: 470a65dee83b3f12673b5ba0e3bf5eb050339b183e01ab26cdc82cb7a110278b1ec32c8564deb24163e2a5c0f8c375638990f90b8937d76fb351337a25efe89e
|
data/lib/modl/parser/parser.rb
CHANGED
@@ -46,7 +46,9 @@ module MODL
|
|
46
46
|
result = parse_structures(tokens)
|
47
47
|
return MODL::Model::Modl.new result[0] if result.length == 1
|
48
48
|
|
49
|
-
MODL::Model::Modl.new
|
49
|
+
return MODL::Model::Modl.new MODL::Model::ModlMap.new(result) if all_pairs?(result)
|
50
|
+
|
51
|
+
MODL::Model::Modl.new MODL::Model::ModlArray.new(result)
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
@@ -59,7 +61,7 @@ module MODL
|
|
59
61
|
until tokens.empty?
|
60
62
|
result.push parse_modl_value(tokens)
|
61
63
|
expect_separator = tokens.shift
|
62
|
-
if !expect_separator.nil? && expect_separator.type
|
64
|
+
if !expect_separator.nil? && expect_separator.type != :struct_sep
|
63
65
|
raise ParserError, "Expected ';' near #{tokens}"
|
64
66
|
end
|
65
67
|
end
|
@@ -281,5 +283,11 @@ module MODL
|
|
281
283
|
end
|
282
284
|
result
|
283
285
|
end
|
286
|
+
|
287
|
+
def self.all_pairs?(arr)
|
288
|
+
result = true
|
289
|
+
arr.each { |i| result = false unless i.instance_of? MODL::Model::ModlPair }
|
290
|
+
result
|
291
|
+
end
|
284
292
|
end
|
285
293
|
end
|
data/lib/modl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Walmsley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
84
|
+
rubygems_version: 3.0.9
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: A Ruby inretpreter for the MODL data serialisation language.
|