Anonymous Login
2018-12-16 10:21 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001734OpenClonkEngine - C4Scriptpublic2017-08-20 12:06
ReporterLuchs 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Product Version 
Target Version9.0Fixed in Version 
Summary0001734: Trailing comma in array literals results in nil
DescriptionHaving a trailing comma in an array literal adds a "nil" value to the array. Ignoring trailing commas is useful for multi-line array literals and already works fine for proplist literals.
Steps To Reproduce./c4script -e 'func Main() { Log("%v", [1,2,3,]); }'

Expected Result: [1, 2, 3]
Actual result: [1, 2, 3, nil]
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0005090

Luchs (administrator)

19:52 <Guenther> Luchs: There was a discussion about the nil values of trailing , a while ago
19:54 <Guenther> 6a5b571fe3f resulted from that
19:56 <Guenther> I guess the entire thing dates back to the previous parser
19:57 <Guenther> In 2006 I rewrote it from a state machine to recursive-descent style
19:57 <Guenther> without breaking compatibility
20:00 <Guenther> If someone wants to enable ExtraWarnings, fix all instances in the repository (adding nil or removing the , as appropriate) and post an argument in the forum for the change, it'd be trivial

(I'm probably going to do that.)
+Notes

-Issue History
Date Modified Username Field Change
2016-05-01 17:34 Luchs New Issue
2016-05-01 19:36 Luchs Note Added: 0005090
2017-08-05 13:58 Maikel Target Version => 8.0
2017-08-20 12:06 Zapper Target Version 8.0 => 9.0
+Issue History