bel_parser 1.0.0.alpha.40-java → 1.0.0.alpha.41-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.
@@ -11,25 +11,25 @@
11
11
  action add_name {
12
12
  trace('SET add_name')
13
13
  key = @buffers.delete(:ident)
14
- @buffers[:set_name] = key
14
+ @buffers[:set_name] = name(key)
15
15
  }
16
16
 
17
17
  action add_ident_value {
18
18
  trace('SET add_ident_value')
19
19
  ident = @buffers.delete(:ident)
20
- @buffers[:set_value] = ident
20
+ @buffers[:set_value] = value(ident)
21
21
  }
22
22
 
23
23
  action add_string_value {
24
24
  trace('SET add_string_value')
25
25
  string = @buffers.delete(:string)
26
- @buffers[:set_value] = string
26
+ @buffers[:set_value] = value(string)
27
27
  }
28
28
 
29
29
  action add_list_value {
30
30
  trace('SET add_list_value')
31
31
  list = @buffers.delete(:list)
32
- @buffers[:set_value] = list
32
+ @buffers[:set_value] = value(list)
33
33
  }
34
34
 
35
35
  action set_end {
@@ -120,6 +120,7 @@
120
120
  @eof(set_node_eof)
121
121
  %set_end
122
122
  %yield_set
123
+ NL
123
124
  ;
124
125
  }%%
125
126
  =end
@@ -19,27 +19,25 @@ module BELParser
19
19
 
20
20
  def self.consume(ast_node, script_context)
21
21
  return nil unless ast_node.is_a?(TARGET_NODE)
22
- name, value = ast_node.children
23
- name_string = name.identifier.string_literal
24
- value_node = ast_node.value.children[0]
22
+ name_node, value_node = ast_node.children
23
+ name_string = name_node.identifier.string_literal
25
24
  case
26
25
  when is_citation?(name_string)
27
26
  handle_citation(value_node, script_context)
28
27
  when is_support?(name_string)
29
28
  handle_support(value_node, script_context)
30
29
  when value_node.is_a?(LIST_NODE)
31
- value_node
30
+ value.node
32
31
  .list_items.map { |li| li.children[0].string_literal }
33
32
  .each do |string|
34
33
  handle_annotation(name_string, string, script_context)
35
34
  end
36
35
  else
37
- value_string = value_node.string_literal
38
36
  case name_string
39
37
  when /\ASTATEMENT_GROUP\Z/
40
- handle_statement_group(value_string, script_context)
38
+ handle_statement_group(value_node, script_context)
41
39
  else
42
- handle_annotation(name_string, value_string, script_context)
40
+ handle_annotation(name_string, value_node, script_context)
43
41
  end
44
42
  end
45
43
  end
@@ -57,18 +55,18 @@ module BELParser
57
55
  end
58
56
 
59
57
  def self.handle_support(value_node, script_context)
60
- script_context[:support] = value_node.string_literal
58
+ script_context[:support] = value_node.children[0].string_literal
61
59
  end
62
60
 
63
- def self.handle_annotation(name, value, script_context)
61
+ def self.handle_annotation(name_string, value_node, script_context)
64
62
  # add to annotation state
65
- script_context[:annotations] ||= Concurrent::Hash.new
66
- script_context[:annotations][name] = value
63
+ script_context[:annotations] ||= Concurrent::Hash.new
64
+ script_context[:annotations][name_string] = value_node.children[0].string_literal
67
65
  end
68
66
  private_class_method :handle_annotation
69
67
 
70
- def self.handle_statement_group(value, script_context)
71
- script_context[:statement_group] = value
68
+ def self.handle_statement_group(value_node, script_context)
69
+ script_context[:statement_group] = value_node.children[0].string_literal
72
70
 
73
71
  # clear annotation state
74
72
  script_context[:annotations] ||= Concurrent::Hash.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bel_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.40
4
+ version: 1.0.0.alpha.41
5
5
  platform: java
6
6
  authors:
7
7
  - Anthony Bargnesi
@@ -12,33 +12,33 @@ cert_chain: []
12
12
  date: 2016-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: sparql-client
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
17
  - - "~>"
19
18
  - !ruby/object:Gem::Version
20
19
  version: 2.0.0
20
+ name: sparql-client
21
+ prerelease: false
22
+ type: :runtime
21
23
  version_requirements: !ruby/object:Gem::Requirement
22
24
  requirements:
23
25
  - - "~>"
24
26
  - !ruby/object:Gem::Version
25
27
  version: 2.0.0
26
- prerelease: false
27
- type: :runtime
28
28
  - !ruby/object:Gem::Dependency
29
- name: dbm-mapdb3
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
31
  - - "~>"
33
32
  - !ruby/object:Gem::Version
34
33
  version: 0.6.0.beta
34
+ name: dbm-mapdb3
35
+ prerelease: false
36
+ type: :runtime
35
37
  version_requirements: !ruby/object:Gem::Requirement
36
38
  requirements:
37
39
  - - "~>"
38
40
  - !ruby/object:Gem::Version
39
41
  version: 0.6.0.beta
40
- prerelease: false
41
- type: :runtime
42
42
  description: Implements language versions 1.0 and 2.0.
43
43
  email: abargnesi@selventa.com
44
44
  executables: