Remove variable_declaration (for now)

pull/1125/head
Rick Carlino 2019-02-15 09:46:52 -06:00
parent 52895adec5
commit fff36ad73b
3 changed files with 4 additions and 5 deletions

View File

@ -132,8 +132,8 @@ module CeleryScript
# catch unbound identifiers
var = resolve_variable!(value)
case var.kind
when "variable_declaration"
actual = var.args[:data_value].kind
when "parameter_declaration"
actual = var.args[:default_value].kind
# Don't delete this- it is currently unreachable code, but as soon as we
# allow identifiers other than `point`, `tool` and `coordinate` we will
# need it again (and can write tests)

View File

@ -76,7 +76,7 @@ module CeleryScriptSettingsBag
ONLY_ONE_COORD = "Move Absolute does not accept a group of locations"\
" as input. Please change your selection to a "\
"single location."
SCOPE_DECLARATIONS = [:variable_declaration, :parameter_declaration]
SCOPE_DECLARATIONS = [ :parameter_declaration ]
ALLOWED_EVERY_POINT_TYPE = %w(Tool GenericPointer Plant ToolSlot)
BAD_EVERY_POINT_TYPE = '"%s" is not a type of group. Allowed values: %s'
@ -246,7 +246,6 @@ module CeleryScriptSettingsBag
.node(:remove_farmware, [:package])
.node(:scope_declaration, [], SCOPE_DECLARATIONS)
.node(:identifier, [:label])
.node(:variable_declaration, [:label, :data_value], []) # <= duplicate nodes
.node(:parameter_application, [:label, :data_value], []) # <= not a mistake - RC
.node(:parameter_declaration, [:label, :default_value], [])
.node(:set_servo_angle, [:pin_number, :pin_value], [])

View File

@ -138,7 +138,7 @@ describe Api::SequencesController do
post :create, body: input.to_json, params: {format: :json}
expect(response.status).to eq(422)
expctd =
"Expected one of: [:variable_declaration, :parameter_declaration]"
"Expected one of: [:parameter_declaration]"
expect(json[:body]).to include(expctd)
end