class BELParser::Script::Syntax::UnsupportedBELVersion
Constants
- TARGET_NODE
AST
node representing a document property (e.g. +SET DOCUMENT …+).
Public Class Methods
map(ast_node, script_context)
click to toggle source
# File lib/bel_parser/script/syntax/unsupported_bel_version.rb, line 17 def self.map(ast_node, script_context) return nil unless ast_node.is_a?(TARGET_NODE) name, value = ast_node.children name_string = name.identifier.string_literal return nil unless is_bel_version?(name_string) value_string = value.children[0].string_literal begin BELParser::Language.specification(value_string) nil rescue ArgumentError script_context[:specification] = BELParser::Language.default_specification UnsupportedBELVersionWarning.new(ast_node, value_string) end end