pythonizer icon indicating copy to clipboard operation
pythonizer copied to clipboard

Complex hash RHS values produces syntax error in the generated code

Open snoopyjc opened this issue 3 years ago • 1 comments

Complex hash RHS values produces syntax error in the generated code. For example:

	my %hop = ( 	"AClli" => $AClli,
		"ZClli" => $ZClli,
		"ID" => $circuitRow[$colNames{"ID"}],
		"mileage" => $circuitRow[$colNames{"mileage"}], 
		"type" => $circuitRow[$colNames{"type"}]
	);

produces:

        hop = {'AClli': AClli, 'ZClli': ZClli,
                   'ID': circuitRow[colNames['ID']]:'mileage': circuitRow[colNames['mileage']], 
                   'type': circuitRow[colNames['type']]}

Note the : before mileage instead of a ,.

snoopyjc avatar Dec 13 '21 19:12 snoopyjc

Fixed in https://github.com/snoopyjc/pythonizer

snoopyjc avatar Feb 07 '22 15:02 snoopyjc