[UNSTABLE] New corpus types implemented. NEXT: Update corpus validation logic.

pull/1125/head
Rick Carlino 2019-02-21 08:43:42 -06:00
parent 3439ae6c9e
commit ba7525bbb7
2 changed files with 5 additions and 9 deletions

View File

@ -47,11 +47,6 @@ module CeleryScript
end
def arg(name, defn, &blk)
defn.map do |x|
binding.pry if x.is_a?(Symbol)
binding.pry if x.is_a?(Class)
puts x.class.inspect
end
@arg_def_list[name] = ArgumentSpecification.new(name, defn, blk)
self
end

View File

@ -210,7 +210,7 @@ module CeleryScriptSettingsBag
end
},
lhs: {
defn: ALLOWED_LHS_TYPES,
defn: [v(:string), n(:named_pin)], # See ALLOWED_LHS_TYPES
blk: -> (node) do
x = [ALLOWED_LHS_STRINGS, node, BAD_LHS]
enum(*x) unless node.is_a?(CeleryScript::AstNode)
@ -280,11 +280,12 @@ module CeleryScriptSettingsBag
end
},
}.map do |(name, conf)|
blk = conf[:blk]
blk = conf[:blk]
defn = conf.fetch(:defn)
if blk
Corpus.arg(name, conf.fetch(:defn), &blk)
Corpus.arg(name, defn, &blk)
else
Corpus.arg(name, conf.fetch(:defn))
Corpus.arg(name, defn)
end
end