modl 0.3.13 → 0.3.14

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: 86f5ec05e9bac3dceff39c2e38fadd43b6f30295329af83bc641c06d89d5714a
4
- data.tar.gz: 4cfff5e76356fa15ab754861976cd353d7a13cb2c00f256b6b37f9298ca9f3f9
3
+ metadata.gz: a8272c24a2a1e013cfd4eb6e6bdfff61aefe3bc3c14d21c2bb074fa5353fb91f
4
+ data.tar.gz: d6e20fcb6c8315ef74138022014247b3911f8583e9f50c22b279a96d6395331d
5
5
  SHA512:
6
- metadata.gz: 3285de14057c2ec9be39e3aad436987ccb6543db419cd8c175c9e520cf306c8ccabd3022caa61e454db6ce8539e55649c79ade9a4b5babc6fa7a74020392ef23
7
- data.tar.gz: e84998430ef02bba1882af4e91dc538783b0a59ee1dcb53022c26ddfc79813947546468e0631653551427142e5a72318a200aac0d14c3dbc7644c2954fba5b2e
6
+ metadata.gz: 933b9a82f45098b11a216bf45d0ed5dae37bfe2bd8ef0b2c84340a9760df8e9b496fca19f0ca5f06b28c28a706f83b9794eb8b0c27c79be08a88ae1e0f1d1450
7
+ data.tar.gz: 7ec8e041d755fe6db94658144a23b18a1f4485e8a2db61729d68f63758de4d412cfdfffe2161401aadbc58310112b048b847dcd6dfde75e365df7192e2e3ca35
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.3.14
2
+ ===
3
+ - MODL Syntax Versioning errors update. GitHub issue #11
4
+ - Support for escpaed % characters - GitHub issue #43
5
+
1
6
  0.3.13
2
7
  ===
3
8
  - Added missing exceptions for Orphan Pairs
@@ -2993,5 +2993,23 @@
2993
2993
  "methods"
2994
2994
  ],
2995
2995
  "minimised_modl": "_test1=e1afmkfd;russian1=%test1.p;_test2=\"e1afmkfd\";russian2=%test2.p;_test3=`e1afmkfd`;russian3=%test3.p;"
2996
+ },
2997
+ {
2998
+ "id": "314",
2999
+ "input": "_letters=abc;key=\"~%letters\"",
3000
+ "expected_output": "{\"key\":\"%letters\"}",
3001
+ "tested_features": [
3002
+ "escape"
3003
+ ],
3004
+ "minimised_modl": "_letters=abc;key=\"~%letters\""
3005
+ },
3006
+ {
3007
+ "id": "315",
3008
+ "input": "_letters=abc;key=\"\\%letters\"",
3009
+ "expected_output": "{\"key\":\"%letters\"}",
3010
+ "tested_features": [
3011
+ "escape"
3012
+ ],
3013
+ "minimised_modl": "_letters=abc;key=\"\\%letters\""
2996
3014
  }
2997
3015
  ]
@@ -48,20 +48,20 @@ module MODL
48
48
  parser.modl.enter_rule(parsed)
49
49
  parsed
50
50
  rescue Antlr4::Runtime::ParseCancellationException => e
51
- check_modl_version(global)
51
+ check_modl_version(global, e)
52
52
  raise ParserError, 'Parser Error: ' + e.message
53
53
  rescue StandardError => e
54
- check_modl_version(global)
54
+ check_modl_version(global, e)
55
55
  raise InterpreterError, 'Interpreter Error: ' + e.message
56
56
  rescue InterpreterError => e
57
- check_modl_version(global)
57
+ check_modl_version(global, e)
58
58
  raise InterpreterError, 'Interpreter Error: ' + e.message
59
59
  end
60
60
  end
61
61
 
62
- def self.check_modl_version(global)
62
+ def self.check_modl_version(global, e)
63
63
  if global.syntax_version > global.interpreter_syntax_version
64
- raise InterpreterError, 'Interpreter Error: MODL Version ' +
64
+ raise InterpreterError, e.message + ' - MODL Version ' +
65
65
  global.interpreter_syntax_version.to_s +
66
66
  ' interpreter cannot process this MODL Version ' +
67
67
  global.syntax_version.to_s + ' file.'
@@ -96,7 +96,7 @@ module MODL
96
96
  end
97
97
  new_value = nil
98
98
  elsif new_value.is_a?(Parsed::ParsedMapItem)
99
- raise InterpreterError, 'Interpreter Error: Found a map when expecting an array'
99
+ raise InterpreterError, 'Found a map when expecting an array'
100
100
  elsif new_value.is_a?(MODL::Parser::MODLParserBaseListener)
101
101
  if new_value.text
102
102
  str = if ref == str
@@ -142,7 +142,7 @@ module MODL
142
142
  result = if n.to_s == p
143
143
  # Numeric ref
144
144
  if !result.nil? && !result.respond_to?(:find_property)
145
- raise InterpreterError, 'Interpreter Error: Invalid object reference: ' + degraved
145
+ raise InterpreterError, 'Invalid object reference: ' + degraved
146
146
  end
147
147
  result.nil? ? global.index_value(n, degraved) : result.find_property(n)
148
148
  else
@@ -198,7 +198,7 @@ module MODL
198
198
  nil
199
199
  else
200
200
  if !result.nil? && !result.respond_to?(:find_property)
201
- raise InterpreterError, 'Interpreter Error: Invalid object reference: ' + degraved
201
+ raise InterpreterError, 'Invalid object reference: ' + degraved
202
202
  end
203
203
  if result.nil?
204
204
  unless ref.start_with?('%`')
@@ -28,6 +28,8 @@ module MODL
28
28
  class Substitutions
29
29
 
30
30
  @@subs = [
31
+ ['~%', '%'],
32
+ ['\\%', '%'],
31
33
  ['~\\', '\\'],
32
34
  ['\\\\', '\\'],
33
35
  ['~~', '~'],
@@ -24,6 +24,6 @@
24
24
 
25
25
  module MODL
26
26
  module Parser
27
- VERSION = "0.3.13"
27
+ VERSION = "0.3.14"
28
28
  end
29
29
  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.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Walmsley
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-29 00:00:00.000000000 Z
11
+ date: 2019-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: antlr4-runtime