From 38a07c0e4d5625a58fd68881f9b35a9fb312c5f5 Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Mon, 30 Oct 2023 22:06:54 -0300 Subject: [PATCH] Raise exception for call without function name --- UJSHOP_Parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UJSHOP_Parser.rb b/UJSHOP_Parser.rb index 0ce9518..3a59193 100644 --- a/UJSHOP_Parser.rb +++ b/UJSHOP_Parser.rb @@ -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