View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0001734 | OpenClonk | Engine - C4Script | public | 2016-05-01 17:34 | 2017-08-20 12:06 | ||||||||
Reporter | Luchs | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | 9.0 | Fixed in Version | |||||||||||
Summary | 0001734: Trailing comma in array literals results in nil | ||||||||||||
Description | Having 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] | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
![]() |
|
Luchs (administrator) 2016-05-01 19:36 |
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.) |