Skip to content

Commit

Permalink
Raise exception for call without function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumagnaguagno committed Oct 31, 2023
1 parent 572d75b commit 38a07c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion UJSHOP_Parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def define_expression(name, group)
raise "Expected single argument for not in #{name}" if group.size != 2
define_expression(name, group.last)
elsif first == 'call'
raise "Unexpected list as function name in #{name}" if group[1].instance_of?(Array)
raise "Expected function name in #{name} call" unless group[1].instance_of?(String)
group.drop(2).each {|g| define_expression(name, g) if g.instance_of?(Array) and g.first == first}
elsif first == 'assign'
raise "Expected 2 arguments for assign in #{name}" if group.size != 3
Expand Down

0 comments on commit 38a07c0

Please sign in to comment.