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 +4 -4
- data/CHANGELOG.md +5 -0
- data/grammar_tests/base_tests.json +18 -0
- data/lib/modl/parser/parser.rb +5 -5
- data/lib/modl/parser/ref_processor.rb +3 -3
- data/lib/modl/parser/substitutions.rb +2 -0
- data/lib/modl/parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8272c24a2a1e013cfd4eb6e6bdfff61aefe3bc3c14d21c2bb074fa5353fb91f
|
4
|
+
data.tar.gz: d6e20fcb6c8315ef74138022014247b3911f8583e9f50c22b279a96d6395331d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 933b9a82f45098b11a216bf45d0ed5dae37bfe2bd8ef0b2c84340a9760df8e9b496fca19f0ca5f06b28c28a706f83b9794eb8b0c27c79be08a88ae1e0f1d1450
|
7
|
+
data.tar.gz: 7ec8e041d755fe6db94658144a23b18a1f4485e8a2db61729d68f63758de4d412cfdfffe2161401aadbc58310112b048b847dcd6dfde75e365df7192e2e3ca35
|
data/CHANGELOG.md
CHANGED
@@ -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
|
]
|
data/lib/modl/parser/parser.rb
CHANGED
@@ -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, '
|
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, '
|
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, '
|
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, '
|
201
|
+
raise InterpreterError, 'Invalid object reference: ' + degraved
|
202
202
|
end
|
203
203
|
if result.nil?
|
204
204
|
unless ref.start_with?('%`')
|
data/lib/modl/parser/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.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-
|
11
|
+
date: 2019-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: antlr4-runtime
|