bel_parser 1.0.0.alpha.46-java → 1.0.0.alpha.47-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bel_parser/expression/model/parameter.rb +1 -1
- data/lib/bel_parser/expression/model/statement.rb +0 -2
- data/lib/bel_parser/expression/model/term.rb +0 -2
- data/lib/bel_parser/language/apply_namespace_encoding.rb +1 -1
- data/lib/bel_parser/language/semantics_ast.rb +2 -7
- data/lib/bel_parser/language/syntax/undefined_namespace.rb +1 -1
- data/lib/bel_parser/language/syntax/undefined_namespace_value.rb +1 -3
- data/lib/bel_parser/script/nanopub_mapper.rb +3 -5
- data/lib/bel_parser/script/state/bel_version.rb +1 -3
- data/lib/bel_parser/script/state/document_property.rb +1 -3
- data/lib/bel_parser/script/state/set.rb +0 -2
- data/lib/bel_parser/script/state/unset.rb +0 -2
- data/lib/bel_parser/script/syntax/expression_validation.rb +0 -2
- data/lib/bel_parser/script/syntax/invalid_regex_pattern.rb +1 -3
- data/lib/bel_parser/script/syntax/undefined_annotation_value.rb +0 -3
- data/lib/bel_parser/script/syntax/unsupported_bel_version.rb +3 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c2fddeaf52fe437892c924831ae99758ab14b95
|
4
|
+
data.tar.gz: 0e473e2c5900240e0e02e9e8831bfa41a043418e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9913e3f53f9feec89720dac1fb43d78c2713e45b75da34a86e59d3a20f1831384ef13b1a13a2db34067e8b36bff4f7752e79d5774f48896ee3948ad7033a23d3
|
7
|
+
data.tar.gz: 16f4963203ecc695f70065a3320c147a32187ae86f7779d72edf39744d47ba8eefa5b34b111b894c083878f719081073a103aad2d308ba30653c486c769f15d6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.alpha.
|
1
|
+
1.0.0.alpha.47
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'bel_parser/quoting'
|
2
1
|
require 'bel_parser/language/relationship'
|
3
2
|
|
4
3
|
module BELParser
|
@@ -114,7 +113,6 @@ module BELParser
|
|
114
113
|
end
|
115
114
|
|
116
115
|
module Converters
|
117
|
-
include BELParser::Quoting
|
118
116
|
include BELParser::Parsers::AST
|
119
117
|
|
120
118
|
def ast_to_statement(ast, spec, namespaces = {})
|
@@ -60,7 +60,7 @@ module BELParser
|
|
60
60
|
return prefix_node unless prefix_node.identifier
|
61
61
|
|
62
62
|
@prefix = prefix_node.identifier.string_literal
|
63
|
-
@type, @dataset = @namespace_hash[@prefix]
|
63
|
+
@type, @dataset = @namespace_hash[@prefix.downcase]
|
64
64
|
return prefix_node unless @dataset
|
65
65
|
|
66
66
|
prefix_node.namespace = @dataset
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'bel_parser/quoting'
|
2
1
|
require_relative 'semantics_match'
|
3
2
|
require_relative 'semantics_result'
|
4
3
|
require_relative 'semantics_ast_warnings'
|
@@ -739,14 +738,12 @@ module BELParser
|
|
739
738
|
UNDETERMINED = /[1?]_[?*]/
|
740
739
|
UNKNOWN_START_STOP = '?'.freeze
|
741
740
|
|
742
|
-
include BELParser::Quoting
|
743
|
-
|
744
741
|
def initialize(**properties)
|
745
742
|
super(:is_amino_acid_range, [], properties)
|
746
743
|
end
|
747
744
|
|
748
745
|
def match(value_node, spec)
|
749
|
-
string_literal =
|
746
|
+
string_literal = value_node.children[0]
|
750
747
|
case string_literal
|
751
748
|
when START_STOP, UNDETERMINED, UNKNOWN_START_STOP
|
752
749
|
success(value_node, spec)
|
@@ -758,14 +755,12 @@ module BELParser
|
|
758
755
|
|
759
756
|
# AST node for IsSequencePosition is a semantic AST.
|
760
757
|
class SemanticIsSequencePosition < SemanticASTNode
|
761
|
-
include BELParser::Quoting
|
762
|
-
|
763
758
|
def initialize(**properties)
|
764
759
|
super(:is_sequence_position, [], properties)
|
765
760
|
end
|
766
761
|
|
767
762
|
def match(value_node, spec)
|
768
|
-
string_literal =
|
763
|
+
string_literal = value_node.children[0].string_literal
|
769
764
|
integer_position =
|
770
765
|
begin
|
771
766
|
Integer(string_literal)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'bel_parser/parsers/ast/node'
|
2
|
-
require 'bel_parser/quoting'
|
3
2
|
|
4
3
|
module BELParser
|
5
4
|
module Language
|
@@ -7,7 +6,6 @@ module BELParser
|
|
7
6
|
# Undefined namespace value finds values that are missing from their
|
8
7
|
# purported namespaces.
|
9
8
|
class UndefinedNamespaceValue
|
10
|
-
extend BELParser::Quoting
|
11
9
|
include SyntaxFunction
|
12
10
|
|
13
11
|
private_class_method :new
|
@@ -17,7 +15,7 @@ module BELParser
|
|
17
15
|
return nil unless value_node.namespace
|
18
16
|
|
19
17
|
unless value_node.namespace_value
|
20
|
-
value =
|
18
|
+
value = value_node.children[0].string_literal
|
21
19
|
UndefinedNamespaceValueWarning.new(value_node, spec, value)
|
22
20
|
end
|
23
21
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'bel_parser/quoting'
|
2
1
|
require_relative '../parsers/serializer'
|
3
2
|
|
4
3
|
module BELParser
|
@@ -7,7 +6,6 @@ module BELParser
|
|
7
6
|
# nanopub hash objects.
|
8
7
|
class NanopubMapper
|
9
8
|
include BELParser::Parsers
|
10
|
-
include BELParser::Quoting
|
11
9
|
|
12
10
|
STATEMENT_TYPES = [
|
13
11
|
:simple_statement,
|
@@ -90,19 +88,19 @@ module BELParser
|
|
90
88
|
def citation(citation)
|
91
89
|
return nil unless citation
|
92
90
|
citation.each do |field, value|
|
93
|
-
citation[field] =
|
91
|
+
citation[field] = value
|
94
92
|
end
|
95
93
|
end
|
96
94
|
|
97
95
|
def support(support)
|
98
|
-
|
96
|
+
support
|
99
97
|
end
|
100
98
|
|
101
99
|
def experiment_context(annotations)
|
102
100
|
(annotations || []).map do |name, value|
|
103
101
|
{
|
104
102
|
name: name,
|
105
|
-
value:
|
103
|
+
value: value
|
106
104
|
}
|
107
105
|
end
|
108
106
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
2
|
require 'bel_parser/parsers/ast/node'
|
3
|
-
require 'bel_parser/quoting'
|
4
3
|
require 'concurrent/hash'
|
5
4
|
require_relative '../keywords'
|
6
5
|
require_relative '../state_function'
|
@@ -10,7 +9,6 @@ module BELParser
|
|
10
9
|
module State
|
11
10
|
class BELVersion
|
12
11
|
extend StateFunction
|
13
|
-
extend BELParser::Quoting
|
14
12
|
extend Keyword
|
15
13
|
|
16
14
|
TARGET_NODE = BELParser::Parsers::AST::DocumentProperty
|
@@ -22,7 +20,7 @@ module BELParser
|
|
22
20
|
name_string = name.identifier.string_literal
|
23
21
|
return unless is_bel_version?(name_string)
|
24
22
|
|
25
|
-
value_string =
|
23
|
+
value_string = value.children[0].string_literal
|
26
24
|
begin
|
27
25
|
spec = BELParser::Language.specification(value_string)
|
28
26
|
rescue ArgumentError
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'bel_parser/parsers/ast/node'
|
2
|
-
require 'bel_parser/quoting'
|
3
2
|
require 'concurrent/hash'
|
4
3
|
require_relative '../state_function'
|
5
4
|
|
@@ -8,7 +7,6 @@ module BELParser
|
|
8
7
|
module State
|
9
8
|
class DocumentProperty
|
10
9
|
extend StateFunction
|
11
|
-
extend BELParser::Quoting
|
12
10
|
|
13
11
|
TARGET_NODE = BELParser::Parsers::AST::DocumentProperty
|
14
12
|
|
@@ -20,7 +18,7 @@ module BELParser
|
|
20
18
|
if name && value
|
21
19
|
name_string = name.identifier.string_literal
|
22
20
|
value_string = value.children[0].string_literal
|
23
|
-
hash[name_string] =
|
21
|
+
hash[name_string] = value_string
|
24
22
|
end
|
25
23
|
end
|
26
24
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
|
-
require 'bel_parser/quoting'
|
3
2
|
require 'bel_parser/parsers/ast/node'
|
4
3
|
require 'concurrent/hash'
|
5
4
|
require_relative '../keywords'
|
@@ -11,7 +10,6 @@ module BELParser
|
|
11
10
|
class Set
|
12
11
|
extend StateFunction
|
13
12
|
extend BELParser::Script::Keyword
|
14
|
-
extend BELParser::Quoting
|
15
13
|
|
16
14
|
TARGET_NODE = BELParser::Parsers::AST::Set
|
17
15
|
LIST_NODE = BELParser::Parsers::AST::List
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
|
-
require 'bel_parser/quoting'
|
3
2
|
require 'bel_parser/parsers/ast/node'
|
4
3
|
require 'concurrent/hash'
|
5
4
|
require_relative '../keywords'
|
@@ -11,7 +10,6 @@ module BELParser
|
|
11
10
|
class Unset
|
12
11
|
extend StateFunction
|
13
12
|
extend BELParser::Script::Keyword
|
14
|
-
extend BELParser::Quoting
|
15
13
|
|
16
14
|
TARGET_NODE = BELParser::Parsers::AST::Unset
|
17
15
|
|
@@ -2,7 +2,6 @@ require 'bel_parser/language'
|
|
2
2
|
require 'bel_parser/language/expression_validator'
|
3
3
|
require 'bel_parser/language/syntax_function'
|
4
4
|
require 'bel_parser/language/syntax_warning'
|
5
|
-
require 'bel_parser/quoting'
|
6
5
|
require 'bel_parser/parsers/ast/node'
|
7
6
|
require 'concurrent/hash'
|
8
7
|
|
@@ -11,7 +10,6 @@ module BELParser
|
|
11
10
|
module Syntax
|
12
11
|
class ExpressionValidation
|
13
12
|
extend BELParser::Language::Syntax::SyntaxFunction
|
14
|
-
extend BELParser::Quoting
|
15
13
|
|
16
14
|
TARGET_NODES = [
|
17
15
|
BELParser::Parsers::AST::ObservedTerm,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
2
|
require 'bel_parser/language/syntax_function'
|
3
3
|
require 'bel_parser/language/syntax_error'
|
4
|
-
require 'bel_parser/quoting'
|
5
4
|
require 'bel_parser/parsers/ast/node'
|
6
5
|
require 'concurrent/hash'
|
7
6
|
|
@@ -10,13 +9,12 @@ module BELParser
|
|
10
9
|
module Syntax
|
11
10
|
class InvalidRegexPattern
|
12
11
|
extend BELParser::Language::Syntax::SyntaxFunction
|
13
|
-
extend BELParser::Quoting
|
14
12
|
|
15
13
|
TARGET_NODE = BELParser::Parsers::AST::Pattern
|
16
14
|
|
17
15
|
def self.map(ast_node, script_context)
|
18
16
|
return nil unless ast_node.is_a?(TARGET_NODE)
|
19
|
-
pattern =
|
17
|
+
pattern = ast_node.string.string_literal
|
20
18
|
begin
|
21
19
|
Regexp.new(pattern)
|
22
20
|
nil
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
2
|
require 'bel_parser/language/syntax_function'
|
3
3
|
require 'bel_parser/language/syntax_warning'
|
4
|
-
require 'bel_parser/quoting'
|
5
4
|
require 'bel_parser/parsers/ast/node'
|
6
5
|
require 'concurrent/hash'
|
7
6
|
require_relative '../keywords'
|
@@ -11,7 +10,6 @@ module BELParser
|
|
11
10
|
module Syntax
|
12
11
|
class UndefinedAnnotationValue
|
13
12
|
extend BELParser::Language::Syntax::SyntaxFunction
|
14
|
-
extend BELParser::Quoting
|
15
13
|
extend BELParser::Script::Keyword
|
16
14
|
|
17
15
|
TARGET_NODE = BELParser::Parsers::AST::Set
|
@@ -57,7 +55,6 @@ module BELParser
|
|
57
55
|
end
|
58
56
|
|
59
57
|
def self.map_value(ast_node, name_string, value_string, identifier, reader)
|
60
|
-
value_string = unquote(value_string)
|
61
58
|
value = reader.retrieve_value_from_resource(identifier, value_string)
|
62
59
|
UndefinedAnnotationValueWarning.new(
|
63
60
|
ast_node,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'bel_parser/language'
|
2
2
|
require 'bel_parser/language/syntax_function'
|
3
3
|
require 'bel_parser/language/syntax_error'
|
4
|
-
require 'bel_parser/quoting'
|
5
4
|
require 'bel_parser/parsers/ast/node'
|
6
5
|
require 'concurrent/hash'
|
7
6
|
require_relative '../keywords'
|
@@ -11,18 +10,17 @@ module BELParser
|
|
11
10
|
module Syntax
|
12
11
|
class UnsupportedBELVersion
|
13
12
|
extend BELParser::Language::Syntax::SyntaxFunction
|
14
|
-
extend BELParser::Quoting
|
15
13
|
extend Keyword
|
16
14
|
|
17
|
-
TARGET_NODE
|
15
|
+
TARGET_NODE = BELParser::Parsers::AST::DocumentProperty
|
18
16
|
|
19
17
|
def self.map(ast_node, script_context)
|
20
18
|
return nil unless ast_node.is_a?(TARGET_NODE)
|
21
19
|
name, value = ast_node.children
|
22
|
-
name_string
|
20
|
+
name_string = name.identifier.string_literal
|
23
21
|
return nil unless is_bel_version?(name_string)
|
24
22
|
|
25
|
-
value_string =
|
23
|
+
value_string = value.children[0].string_literal
|
26
24
|
begin
|
27
25
|
BELParser::Language.specification(value_string)
|
28
26
|
nil
|