class BELParser::Script::State::Unset
Constants
- TARGET_NODE
AST
node representing an unset.
Public Class Methods
consume(ast_node, script_context)
click to toggle source
# File lib/bel_parser/script/state/unset.rb, line 16 def self.consume(ast_node, script_context) return nil unless ast_node.is_a?(TARGET_NODE) name_string = ast_node.name.identifier.string_literal case name_string when /\ASTATEMENT_GROUP\Z/ handle_statement_group(script_context) else handle_annotation(name_string, script_context) end end
Private Class Methods
handle_annotation(name, script_context)
click to toggle source
# File lib/bel_parser/script/state/unset.rb, line 27 def self.handle_annotation(name, script_context) script_context[:annotations] ||= Concurrent::Hash.new script_context[:annotations].delete(name) script_context[:citation] = nil if is_citation?(name) end
handle_statement_group(script_context)
click to toggle source
# File lib/bel_parser/script/state/unset.rb, line 34 def self.handle_statement_group(script_context) script_context.delete(:statement_group) script_context[:annotations] ||= Concurrent::Hash.new script_context[:annotations].clear script_context[:citation] = nil end