bel_parser 1.0.8 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemspec +12 -2
- data/VERSION +1 -1
- data/bin/bel2_compatibility +12 -9
- data/bin/bel2_upgrade +18 -6
- data/bin/bel2_validator +6 -3
- data/bin/bel_script_reader +1 -0
- data/lib/bel_parser/completion.rb +984 -0
- data/lib/bel_parser/language/apply_namespace_encoding.rb +14 -3
- data/lib/bel_parser/language/expression_validator.rb +1 -2
- data/lib/bel_parser/language/function.rb +4 -0
- data/lib/bel_parser/language/relationship.rb +4 -0
- data/lib/bel_parser/language/semantics/function_deprecation.rb +1 -0
- data/lib/bel_parser/language/semantics/list_function_subject.rb +2 -0
- data/lib/bel_parser/language/semantics/multiple_subject_object.rb +4 -1
- data/lib/bel_parser/language/semantics/nested_statement_without_object.rb +43 -0
- data/lib/bel_parser/language/semantics/non_object_list.rb +3 -0
- data/lib/bel_parser/language/semantics/relationship_not_listable.rb +2 -0
- data/lib/bel_parser/language/semantics/signature_mapping.rb +2 -0
- data/lib/bel_parser/language/semantics_ast.rb +0 -7
- data/lib/bel_parser/language/syntax/invalid_function.rb +6 -1
- data/lib/bel_parser/language/syntax/invalid_relationship.rb +1 -0
- data/lib/bel_parser/language/version1_0/relationships/acts_in.rb +9 -9
- data/lib/bel_parser/language/version1_0/relationships/analogous.rb +6 -4
- data/lib/bel_parser/language/version1_0/relationships/association.rb +8 -7
- data/lib/bel_parser/language/version1_0/relationships/biomarker_for.rb +6 -5
- data/lib/bel_parser/language/version1_0/relationships/causes_no_change.rb +8 -7
- data/lib/bel_parser/language/version1_0/relationships/decreases.rb +13 -12
- data/lib/bel_parser/language/version1_0/relationships/directly_decreases.rb +8 -6
- data/lib/bel_parser/language/version1_0/relationships/directly_increases.rb +8 -6
- data/lib/bel_parser/language/version1_0/relationships/has_component.rb +14 -14
- data/lib/bel_parser/language/version1_0/relationships/has_components.rb +12 -11
- data/lib/bel_parser/language/version1_0/relationships/has_member.rb +10 -8
- data/lib/bel_parser/language/version1_0/relationships/has_members.rb +12 -11
- data/lib/bel_parser/language/version1_0/relationships/has_modification.rb +9 -7
- data/lib/bel_parser/language/version1_0/relationships/has_product.rb +10 -8
- data/lib/bel_parser/language/version1_0/relationships/has_variant.rb +9 -7
- data/lib/bel_parser/language/version1_0/relationships/includes.rb +11 -10
- data/lib/bel_parser/language/version1_0/relationships/increases.rb +12 -13
- data/lib/bel_parser/language/version1_0/relationships/is_a.rb +10 -8
- data/lib/bel_parser/language/version1_0/relationships/negative_correlation.rb +9 -7
- data/lib/bel_parser/language/version1_0/relationships/orthologous.rb +9 -8
- data/lib/bel_parser/language/version1_0/relationships/positive_correlation.rb +8 -5
- data/lib/bel_parser/language/version1_0/relationships/prognostic_biomarker_for.rb +8 -6
- data/lib/bel_parser/language/version1_0/relationships/rate_limiting_step_of.rb +10 -9
- data/lib/bel_parser/language/version1_0/relationships/reactant_in.rb +10 -8
- data/lib/bel_parser/language/version1_0/relationships/sub_process_of.rb +13 -12
- data/lib/bel_parser/language/version1_0/relationships/transcribed_to.rb +8 -7
- data/lib/bel_parser/language/version1_0/relationships/translated_to.rb +9 -7
- data/lib/bel_parser/language/version1_0/relationships/translocates.rb +10 -9
- data/lib/bel_parser/language/version2_0/functions/protein_modification.rb +1 -2
- data/lib/bel_parser/language/version2_0/functions/translocation.rb +1 -2
- data/lib/bel_parser/language/version2_0/functions/variant.rb +1 -2
- data/lib/bel_parser/language/version2_0/relationships/acts_in.rb +10 -9
- data/lib/bel_parser/language/version2_0/relationships/biomarker_for.rb +7 -5
- data/lib/bel_parser/language/version2_0/relationships/causes_no_change.rb +9 -7
- data/lib/bel_parser/language/version2_0/relationships/decreases.rb +13 -12
- data/lib/bel_parser/language/version2_0/relationships/directly_decreases.rb +8 -6
- data/lib/bel_parser/language/version2_0/relationships/directly_increases.rb +8 -6
- data/lib/bel_parser/language/version2_0/relationships/has_component.rb +15 -14
- data/lib/bel_parser/language/version2_0/relationships/has_components.rb +12 -11
- data/lib/bel_parser/language/version2_0/relationships/has_member.rb +9 -8
- data/lib/bel_parser/language/version2_0/relationships/has_members.rb +12 -11
- data/lib/bel_parser/language/version2_0/relationships/has_modification.rb +9 -7
- data/lib/bel_parser/language/version2_0/relationships/has_product.rb +10 -8
- data/lib/bel_parser/language/version2_0/relationships/has_variant.rb +9 -7
- data/lib/bel_parser/language/version2_0/relationships/includes.rb +11 -10
- data/lib/bel_parser/language/version2_0/relationships/increases.rb +13 -12
- data/lib/bel_parser/language/version2_0/relationships/is_a.rb +10 -8
- data/lib/bel_parser/language/version2_0/relationships/negative_correlation.rb +9 -7
- data/lib/bel_parser/language/version2_0/relationships/orthologous.rb +10 -8
- data/lib/bel_parser/language/version2_0/relationships/positive_correlation.rb +7 -5
- data/lib/bel_parser/language/version2_0/relationships/prognostic_biomarker_for.rb +8 -6
- data/lib/bel_parser/language/version2_0/relationships/rate_limiting_step_of.rb +10 -9
- data/lib/bel_parser/language/version2_0/relationships/reactant_in.rb +10 -8
- data/lib/bel_parser/language/version2_0/relationships/regulates.rb +9 -8
- data/lib/bel_parser/language/version2_0/relationships/sub_process_of.rb +13 -12
- data/lib/bel_parser/language/version2_0/relationships/transcribed_to.rb +8 -7
- data/lib/bel_parser/language/version2_0/relationships/translated_to.rb +9 -7
- data/lib/bel_parser/language/version2_0/relationships/translocates.rb +10 -9
- data/lib/bel_parser/mixin/levenshtein.rb +20 -0
- data/lib/bel_parser/parsers/ast/node.rb +49 -2
- data/lib/bel_parser/parsers/bel_script/define_annotation.rb +156 -156
- data/lib/bel_parser/parsers/bel_script/define_namespace.rb +60 -60
- data/lib/bel_parser/parsers/bel_script/set.rb +200 -200
- data/lib/bel_parser/parsers/bel_script/set_document.rb +188 -188
- data/lib/bel_parser/parsers/bel_script/unset.rb +14 -14
- data/lib/bel_parser/parsers/common/common.rl +1 -0
- data/lib/bel_parser/parsers/common/function.rb +8 -8
- data/lib/bel_parser/parsers/common/function.rl +6 -6
- data/lib/bel_parser/parsers/common/identifier.rb +3 -3
- data/lib/bel_parser/parsers/common/identifier.rl +4 -4
- data/lib/bel_parser/parsers/common/list.rb +78 -78
- data/lib/bel_parser/parsers/common/multi_identifier.rb +275 -0
- data/lib/bel_parser/parsers/common/multi_identifier.rl +141 -0
- data/lib/bel_parser/parsers/common/string.rb +6 -6
- data/lib/bel_parser/parsers/common/string.rl +4 -4
- data/lib/bel_parser/parsers/common.rb +1 -0
- data/lib/bel_parser/parsers/expression/nested_statement.rb +30180 -29055
- data/lib/bel_parser/parsers/expression/observed_term.rb +1456 -1099
- data/lib/bel_parser/parsers/expression/parameter.rb +192 -111
- data/lib/bel_parser/parsers/expression/parameter.rl +6 -3
- data/lib/bel_parser/parsers/expression/relationship.rb +43 -19
- data/lib/bel_parser/parsers/expression/relationship.rl +1 -0
- data/lib/bel_parser/parsers/expression/simple_statement.rb +17805 -17093
- data/lib/bel_parser/parsers/expression/statement_autocomplete.rb +1035 -0
- data/lib/bel_parser/parsers/expression/statement_autocomplete.rl +736 -0
- data/lib/bel_parser/parsers/expression/term.rb +960 -705
- data/lib/bel_parser/parsers/serializer.rb +8 -4
- data/lib/bel_parser/version.rb +33 -0
- data/lib/bel_parser.rb +3 -0
- metadata +25 -3
@@ -10,14 +10,14 @@
|
|
10
10
|
action add_ident_param_value {
|
11
11
|
trace('PARAMETER add_ident_param_value')
|
12
12
|
ident = @buffers.delete(:ident)
|
13
|
-
value_node = value(ident, complete: ident.complete)
|
13
|
+
value_node = value(ident, complete: ident.complete, character_range: ident.character_range)
|
14
14
|
@buffers[:param_value] = value_node
|
15
15
|
}
|
16
16
|
|
17
17
|
action add_string_param_value {
|
18
18
|
trace('PARAMETER add_string_param_value')
|
19
19
|
string_node = @buffers.delete(:string)
|
20
|
-
value_node = value(string_node, complete: string_node.complete)
|
20
|
+
value_node = value(string_node, complete: string_node.complete, character_range: string_node.character_range)
|
21
21
|
@buffers[:param_value] = value_node
|
22
22
|
}
|
23
23
|
|
@@ -32,6 +32,7 @@
|
|
32
32
|
trace('PN incomplete')
|
33
33
|
completed = false
|
34
34
|
end
|
35
|
+
param_start = prefix_node.range_start
|
35
36
|
else
|
36
37
|
prefix_node = prefix(nil)
|
37
38
|
prefix_node.complete = true
|
@@ -48,6 +49,8 @@
|
|
48
49
|
trace('VN incomplete')
|
49
50
|
completed = false
|
50
51
|
end
|
52
|
+
param_start ||= value_node.range_start
|
53
|
+
param_node.character_range = [param_start, value_node.range_end]
|
51
54
|
else
|
52
55
|
completed = false
|
53
56
|
end
|
@@ -59,7 +62,7 @@
|
|
59
62
|
action add_prefix {
|
60
63
|
trace('PARAMETER add_prefix')
|
61
64
|
ident = @buffers.delete(:ident)
|
62
|
-
prefix_node = prefix(ident, complete: ident.complete)
|
65
|
+
prefix_node = prefix(ident, complete: ident.complete, character_range: ident.character_range)
|
63
66
|
@buffers[:param_prefix] = prefix_node
|
64
67
|
}
|
65
68
|
|
@@ -46,8 +46,8 @@ class << self
|
|
46
46
|
private :_bel_trans_keys, :_bel_trans_keys=
|
47
47
|
end
|
48
48
|
self._bel_trans_keys = [
|
49
|
-
0, 0, 33, 126,
|
50
|
-
0
|
49
|
+
0, 0, 33, 126, 10, 126,
|
50
|
+
0, 0, 0
|
51
51
|
]
|
52
52
|
|
53
53
|
class << self
|
@@ -55,7 +55,7 @@ class << self
|
|
55
55
|
private :_bel_key_spans, :_bel_key_spans=
|
56
56
|
end
|
57
57
|
self._bel_key_spans = [
|
58
|
-
0, 94,
|
58
|
+
0, 94, 117, 0
|
59
59
|
]
|
60
60
|
|
61
61
|
class << self
|
@@ -63,7 +63,7 @@ class << self
|
|
63
63
|
private :_bel_index_offsets, :_bel_index_offsets=
|
64
64
|
end
|
65
65
|
self._bel_index_offsets = [
|
66
|
-
0, 0, 95
|
66
|
+
0, 0, 95, 213
|
67
67
|
]
|
68
68
|
|
69
69
|
class << self
|
@@ -83,18 +83,21 @@ self._bel_indicies = [
|
|
83
83
|
0, 0, 0, 0, 0, 0, 0, 0,
|
84
84
|
0, 0, 0, 0, 0, 0, 0, 0,
|
85
85
|
0, 0, 0, 0, 0, 0, 1, 2,
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
86
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
87
|
+
1, 1, 1, 1, 1, 1, 1, 1,
|
88
|
+
1, 1, 1, 1, 1, 1, 3, 3,
|
89
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
90
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
91
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
92
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
93
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
94
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
95
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
96
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
97
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
98
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
99
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
100
|
+
3, 3, 3, 3, 1, 1, 0
|
98
101
|
]
|
99
102
|
|
100
103
|
class << self
|
@@ -102,7 +105,7 @@ class << self
|
|
102
105
|
private :_bel_trans_targs, :_bel_trans_targs=
|
103
106
|
end
|
104
107
|
self._bel_trans_targs = [
|
105
|
-
2, 0, 2
|
108
|
+
2, 0, 3, 2
|
106
109
|
]
|
107
110
|
|
108
111
|
class << self
|
@@ -110,7 +113,7 @@ class << self
|
|
110
113
|
private :_bel_trans_actions, :_bel_trans_actions=
|
111
114
|
end
|
112
115
|
self._bel_trans_actions = [
|
113
|
-
1, 0, 0
|
116
|
+
1, 0, 3, 0
|
114
117
|
]
|
115
118
|
|
116
119
|
class << self
|
@@ -118,7 +121,7 @@ class << self
|
|
118
121
|
private :_bel_eof_actions, :_bel_eof_actions=
|
119
122
|
end
|
120
123
|
self._bel_eof_actions = [
|
121
|
-
0, 0, 2
|
124
|
+
0, 0, 2, 4
|
122
125
|
]
|
123
126
|
|
124
127
|
class << self
|
@@ -205,6 +208,14 @@ begin
|
|
205
208
|
trace('RELATIONSHIP start_relationship')
|
206
209
|
p_start = p;
|
207
210
|
end
|
211
|
+
when 3 then
|
212
|
+
begin
|
213
|
+
|
214
|
+
trace('RELATIONSHIP stop_relationship')
|
215
|
+
# It's not you, it's me. You're a p and I'm a non-protein coding r. It
|
216
|
+
# would never work, I just can't reach you.
|
217
|
+
p_end = p;
|
218
|
+
end
|
208
219
|
end
|
209
220
|
end
|
210
221
|
end
|
@@ -222,6 +233,19 @@ begin
|
|
222
233
|
if _goto_level <= _test_eof
|
223
234
|
if p == eof
|
224
235
|
case _bel_eof_actions[cs]
|
236
|
+
when 4 then
|
237
|
+
begin
|
238
|
+
|
239
|
+
trace('RELATIONSHIP relationship_end')
|
240
|
+
chars = data[p_start...p_end]
|
241
|
+
completed = !chars.empty?
|
242
|
+
ast_node = relationship(utf8_string(chars), complete: completed)
|
243
|
+
@buffers[:relationship] = ast_node
|
244
|
+
end
|
245
|
+
begin
|
246
|
+
|
247
|
+
yield @buffers[:relationship]
|
248
|
+
end
|
225
249
|
when 2 then
|
226
250
|
begin
|
227
251
|
|