Accept idents as KW args (#6644)

Support kw arg/local variable shorthand

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-15 07:42:48 +12:00
committed by GitHub
parent b23fc9f623
commit ce566fb6e5
9 changed files with 232 additions and 191 deletions

View File

@ -456,13 +456,7 @@ description: Result of parsing enclosure.kcl
},
{
"type": "LabeledArg",
"label": {
"commentStart": 0,
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"label": null,
"arg": {
"abs_path": false,
"commentStart": 0,
@ -3178,13 +3172,7 @@ description: Result of parsing enclosure.kcl
},
{
"type": "LabeledArg",
"label": {
"commentStart": 0,
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"label": null,
"arg": {
"abs_path": false,
"commentStart": 0,

View File

@ -28,9 +28,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 485,
"end": 506,
"start": 485,
"commentStart": 476,
"end": 497,
"start": 476,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
@ -41,9 +41,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 608,
"end": 629,
"start": 608,
"commentStart": 599,
"end": 620,
"start": 599,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
@ -54,9 +54,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 699,
"end": 720,
"start": 699,
"commentStart": 690,
"end": 711,
"start": 690,
"type": "TagDeclarator",
"value": "rectangleSegmentD001"
},
@ -102,9 +102,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 485,
"end": 506,
"start": 485,
"commentStart": 476,
"end": 497,
"start": 476,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
@ -127,9 +127,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 608,
"end": 629,
"start": 608,
"commentStart": 599,
"end": 620,
"start": 599,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
@ -152,9 +152,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 699,
"end": 720,
"start": 699,
"commentStart": 690,
"end": 711,
"start": 690,
"type": "TagDeclarator",
"value": "rectangleSegmentD001"
},
@ -354,9 +354,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -367,9 +367,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -380,9 +380,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -393,9 +393,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},
@ -416,9 +416,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -441,9 +441,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -466,9 +466,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -491,9 +491,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},
@ -693,9 +693,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 4147,
"end": 4168,
"start": 4147,
"commentStart": 4129,
"end": 4150,
"start": 4129,
"type": "TagDeclarator",
"value": "rectangleSegmentA003"
},
@ -706,9 +706,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 4274,
"end": 4295,
"start": 4274,
"commentStart": 4256,
"end": 4277,
"start": 4256,
"type": "TagDeclarator",
"value": "rectangleSegmentB003"
},
@ -719,9 +719,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 4397,
"end": 4418,
"start": 4397,
"commentStart": 4379,
"end": 4400,
"start": 4379,
"type": "TagDeclarator",
"value": "rectangleSegmentC003"
},
@ -732,9 +732,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 4488,
"end": 4509,
"start": 4488,
"commentStart": 4470,
"end": 4491,
"start": 4470,
"type": "TagDeclarator",
"value": "rectangleSegmentD003"
},
@ -755,9 +755,9 @@ description: Variables in memory after executing enclosure.kcl
3.0
],
"tag": {
"commentStart": 4147,
"end": 4168,
"start": 4147,
"commentStart": 4129,
"end": 4150,
"start": 4129,
"type": "TagDeclarator",
"value": "rectangleSegmentA003"
},
@ -780,9 +780,9 @@ description: Variables in memory after executing enclosure.kcl
3.0
],
"tag": {
"commentStart": 4274,
"end": 4295,
"start": 4274,
"commentStart": 4256,
"end": 4277,
"start": 4256,
"type": "TagDeclarator",
"value": "rectangleSegmentB003"
},
@ -805,9 +805,9 @@ description: Variables in memory after executing enclosure.kcl
172.0
],
"tag": {
"commentStart": 4397,
"end": 4418,
"start": 4397,
"commentStart": 4379,
"end": 4400,
"start": 4379,
"type": "TagDeclarator",
"value": "rectangleSegmentC003"
},
@ -830,9 +830,9 @@ description: Variables in memory after executing enclosure.kcl
172.0
],
"tag": {
"commentStart": 4488,
"end": 4509,
"start": 4488,
"commentStart": 4470,
"end": 4491,
"start": 4470,
"type": "TagDeclarator",
"value": "rectangleSegmentD003"
},
@ -896,9 +896,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -909,9 +909,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -922,9 +922,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -935,9 +935,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},
@ -958,9 +958,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -983,9 +983,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -1008,9 +1008,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -1033,9 +1033,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},
@ -1495,9 +1495,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 485,
"end": 506,
"start": 485,
"commentStart": 476,
"end": 497,
"start": 476,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
@ -1520,9 +1520,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 608,
"end": 629,
"start": 608,
"commentStart": 599,
"end": 620,
"start": 599,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
@ -1545,9 +1545,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 699,
"end": 720,
"start": 699,
"commentStart": 690,
"end": 711,
"start": 690,
"type": "TagDeclarator",
"value": "rectangleSegmentD001"
},
@ -1669,9 +1669,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -1694,9 +1694,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -1719,9 +1719,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -1744,9 +1744,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},
@ -1868,9 +1868,9 @@ description: Variables in memory after executing enclosure.kcl
3.0
],
"tag": {
"commentStart": 4147,
"end": 4168,
"start": 4147,
"commentStart": 4129,
"end": 4150,
"start": 4129,
"type": "TagDeclarator",
"value": "rectangleSegmentA003"
},
@ -1893,9 +1893,9 @@ description: Variables in memory after executing enclosure.kcl
3.0
],
"tag": {
"commentStart": 4274,
"end": 4295,
"start": 4274,
"commentStart": 4256,
"end": 4277,
"start": 4256,
"type": "TagDeclarator",
"value": "rectangleSegmentB003"
},
@ -1918,9 +1918,9 @@ description: Variables in memory after executing enclosure.kcl
172.0
],
"tag": {
"commentStart": 4397,
"end": 4418,
"start": 4397,
"commentStart": 4379,
"end": 4400,
"start": 4379,
"type": "TagDeclarator",
"value": "rectangleSegmentC003"
},
@ -1943,9 +1943,9 @@ description: Variables in memory after executing enclosure.kcl
172.0
],
"tag": {
"commentStart": 4488,
"end": 4509,
"start": 4488,
"commentStart": 4470,
"end": 4491,
"start": 4470,
"type": "TagDeclarator",
"value": "rectangleSegmentD003"
},
@ -2009,9 +2009,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -2022,9 +2022,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -2035,9 +2035,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -2048,9 +2048,9 @@ description: Variables in memory after executing enclosure.kcl
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},
@ -2071,9 +2071,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2445,
"end": 2466,
"start": 2445,
"commentStart": 2436,
"end": 2457,
"start": 2436,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
@ -2096,9 +2096,9 @@ description: Variables in memory after executing enclosure.kcl
0.0
],
"tag": {
"commentStart": 2550,
"end": 2571,
"start": 2550,
"commentStart": 2532,
"end": 2553,
"start": 2532,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
@ -2121,9 +2121,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2673,
"end": 2694,
"start": 2673,
"commentStart": 2655,
"end": 2676,
"start": 2655,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
@ -2146,9 +2146,9 @@ description: Variables in memory after executing enclosure.kcl
175.0
],
"tag": {
"commentStart": 2764,
"end": 2785,
"start": 2764,
"commentStart": 2746,
"end": 2767,
"start": 2746,
"type": "TagDeclarator",
"value": "rectangleSegmentD002"
},