mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* update grammar * add ast nodes; ast building * Rename to unpacking * semantic analysis * executor work part 1, unpacking indices * renamings; implement index binding * small cleanup * use multi_index; more tests * use multi_index only for rest, otherwise list * initial formatting * add missing token decoding * address self-review comments * formatting tweaks * add test for var binding in classes * add StringIterator * fix spread tests * add cfgfile iterator; add cfgelem opersubscript; tests * add iterator for SQLResultSet and SQLRow; tests * Copy value in take global/local * Allow any iterable can index rest unpacking Always use dictionary as rest object in index unpacking * add docs, core-changes, doc tests * formatting changes... * address self-review comments * update formatter, format all binding test srcs * address review comments - unset var scope * add cfgfile/cfgelem docs * reformat objref svg
47 lines
1.8 KiB
Text
47 lines
1.8 KiB
Text
var [ { name: firstName,
|
|
color: firstColor,
|
|
lastcoord: { lastx: firstX,
|
|
lasty: firstY,
|
|
lastz: firstZ },
|
|
firstRest... },
|
|
{ name: secondName,
|
|
reportables: [
|
|
secondRep1,
|
|
secondRestReps... ],
|
|
secondRest... },
|
|
remaining... ] := array{ struct{ name := "FIRSTNAME",
|
|
color := "FIRSTCOLOR",
|
|
lastcoord := struct{ lastx := 1, lasty := 2, lastz := 3 },
|
|
reportables := {}
|
|
},
|
|
struct{
|
|
name := "SECONDNAME",
|
|
color := "SECONDCOLOR",
|
|
lastcoord := struct{ lastx := 4, lasty := 5, lastz := 6 },
|
|
reportables := { "REP1",
|
|
"REP2",
|
|
"REP3" }
|
|
},
|
|
struct{
|
|
name := "THIRDNAME",
|
|
color := "THIRDCOLOR",
|
|
lastcoord := struct{ lastx := 7, lasty := 8, lastz := 9 },
|
|
reportables := {}
|
|
} };
|
|
|
|
var { lastcoord: { lastx: secondX, lasty: secondY, lastz: secondZ } } := secondRest;
|
|
|
|
print( firstName );
|
|
print( firstColor );
|
|
print( firstRest );
|
|
print( firstX );
|
|
print( firstY );
|
|
print( firstZ );
|
|
print( secondName );
|
|
print( secondRep1 );
|
|
print( secondRestReps );
|
|
print( secondRest );
|
|
print( secondX );
|
|
print( secondY );
|
|
print( secondZ );
|
|
print( remaining );
|