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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19413632838d38b40c5079a2b4c4551681ba94fc67c03a9b5aba98ef3bab522b
4
- data.tar.gz: 74648b6833fdd3a9562bfde9ce8ddbaeea71439b751d19cd4487d5c586f918e1
3
+ metadata.gz: f38dca1aa60310b7fab61c2903d9f5a8aef61b16b3e75fc2820e9c4bcd874680
4
+ data.tar.gz: 3f139db340886f4ecaff8633178bee2f81de07d628e4b660ba3c9a81570681d7
5
5
  SHA512:
6
- metadata.gz: a2e31d1efa2d9668c94f503f1b0d5cdc19c9ea484dd85314e6697a6647ef44bed2213515ad3031839e38bf459a7e68497434b195f2f9cf5e54ce81203bfd03e0
7
- data.tar.gz: c9dec885b8ea5acc8799c405379f3848dbac48f5dc919ae27f34d2d2d2bc8dda1fdee18620477f3867e747e00ba0baf2b940b1f62d29c7fa71055bb857cedc5f
6
+ metadata.gz: 22aa26fe242cbef6c107a0d11108a1b55eb1db8a3846f846de336102be16c85c7e658614a218dc5dba5c10b087e3937d769f634590a0a1c5f413fa6e0825ea63
7
+ data.tar.gz: 470a65dee83b3f12673b5ba0e3bf5eb050339b183e01ab26cdc82cb7a110278b1ec32c8564deb24163e2a5c0f8c375638990f90b8937d76fb351337a25efe89e
@@ -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 ModlArray.new(result)
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 == :struct_sep
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MODL
4
- VERSION = '0.3.27'
4
+ VERSION = '0.3.28'
5
5
  end
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.27
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-04 00:00:00.000000000 Z
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.3.7
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.