@@ -759,6 +759,20 @@ def test_proc_args():
759759 )
760760 )
761761
762+ command = tree .children [0 ]
763+ args_list = command .args [1 ]
764+ assert args_list .pos == (1 , 10 )
765+ assert args_list .end_pos == (1 , 23 )
766+ arg1 = args_list .children [0 ]
767+ assert arg1 .pos == (1 , 12 )
768+ arg2 = args_list .children [1 ]
769+ assert arg2 .pos == (1 , 14 )
770+ assert arg2 .end_pos == (1 , 21 )
771+ arg2_name = arg2 .children [0 ]
772+ assert arg2_name .pos == (1 , 16 )
773+ arg2_default = arg2 .children [1 ]
774+ assert arg2_default .pos == (1 , 18 )
775+
762776
763777def test_broken_command ():
764778 def bad_command_parser (* args ):
@@ -786,3 +800,15 @@ def test_expr_unbalanced_close_paren():
786800 # close paren was silently dropped).
787801 with pytest .raises (TclSyntaxError ):
788802 parse ("expr {$foo )}" )
803+
804+
805+ def test_unbraced_list ():
806+ script = "proc foo foo {}"
807+ tree = parse (script )
808+ assert tree == Script (
809+ Command (BareWord ("proc" ), BareWord ("foo" ), List (BareWord ("foo" )), Script ())
810+ )
811+ command = tree .children [0 ]
812+ args_list_node = command .args [1 ]
813+ assert args_list_node .pos == (1 , 10 )
814+ assert args_list_node .children [0 ].pos == (1 , 10 )
0 commit comments