Support comments on attributes (#5850)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-03-20 16:23:20 +13:00
committed by GitHub
parent 79be72c5f0
commit 461a2c3ab2
319 changed files with 37650 additions and 4752 deletions

View File

@ -6,17 +6,22 @@ description: Result of parsing array_elem_pop.kcl
"Ok": {
"body": [
{
"commentStart": 0,
"declaration": {
"commentStart": 0,
"end": 0,
"id": {
"commentStart": 0,
"end": 0,
"name": "arr",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 6,
"elements": [
{
"commentStart": 7,
"end": 0,
"raw": "1",
"start": 0,
@ -28,6 +33,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 10,
"end": 0,
"raw": "2",
"start": 0,
@ -39,6 +45,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 13,
"end": 0,
"raw": "3",
"start": 0,
@ -65,9 +72,12 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration"
},
{
"commentStart": 16,
"declaration": {
"commentStart": 16,
"end": 0,
"id": {
"commentStart": 16,
"end": 0,
"name": "new_arr1",
"start": 0,
@ -76,6 +86,7 @@ description: Result of parsing array_elem_pop.kcl
"init": {
"arguments": [
{
"commentStart": 31,
"end": 0,
"name": "arr",
"start": 0,
@ -84,11 +95,13 @@ description: Result of parsing array_elem_pop.kcl
}
],
"callee": {
"commentStart": 27,
"end": 0,
"name": "pop",
"start": 0,
"type": "Identifier"
},
"commentStart": 27,
"end": 0,
"start": 0,
"type": "CallExpression",
@ -104,9 +117,12 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration"
},
{
"commentStart": 36,
"declaration": {
"commentStart": 36,
"end": 0,
"id": {
"commentStart": 36,
"end": 0,
"name": "new_arr2",
"start": 0,
@ -115,6 +131,7 @@ description: Result of parsing array_elem_pop.kcl
"init": {
"arguments": [
{
"commentStart": 51,
"end": 0,
"name": "new_arr1",
"start": 0,
@ -123,11 +140,13 @@ description: Result of parsing array_elem_pop.kcl
}
],
"callee": {
"commentStart": 47,
"end": 0,
"name": "pop",
"start": 0,
"type": "Identifier"
},
"commentStart": 47,
"end": 0,
"start": 0,
"type": "CallExpression",
@ -143,9 +162,12 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration"
},
{
"commentStart": 61,
"declaration": {
"commentStart": 61,
"end": 0,
"id": {
"commentStart": 61,
"end": 0,
"name": "new_arr3",
"start": 0,
@ -154,6 +176,7 @@ description: Result of parsing array_elem_pop.kcl
"init": {
"arguments": [
{
"commentStart": 76,
"end": 0,
"name": "new_arr2",
"start": 0,
@ -162,11 +185,13 @@ description: Result of parsing array_elem_pop.kcl
}
],
"callee": {
"commentStart": 72,
"end": 0,
"name": "pop",
"start": 0,
"type": "Identifier"
},
"commentStart": 72,
"end": 0,
"start": 0,
"type": "CallExpression",
@ -182,13 +207,16 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration"
},
{
"commentStart": 86,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 98,
"computed": false,
"end": 0,
"object": {
"commentStart": 98,
"end": 0,
"name": "new_arr1",
"start": 0,
@ -196,6 +224,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "Identifier"
},
"property": {
"commentStart": 107,
"end": 0,
"raw": "0",
"start": 0,
@ -211,6 +240,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "MemberExpression"
},
{
"commentStart": 111,
"end": 0,
"raw": "1",
"start": 0,
@ -222,6 +252,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 114,
"end": 0,
"raw": "0.00001",
"start": 0,
@ -233,6 +264,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 123,
"end": 0,
"raw": "\"element 0 should not have changed\"",
"start": 0,
@ -242,11 +274,13 @@ description: Result of parsing array_elem_pop.kcl
}
],
"callee": {
"commentStart": 86,
"end": 0,
"name": "assertEqual",
"start": 0,
"type": "Identifier"
},
"commentStart": 86,
"end": 0,
"start": 0,
"type": "CallExpression",
@ -257,13 +291,16 @@ description: Result of parsing array_elem_pop.kcl
"type": "ExpressionStatement"
},
{
"commentStart": 160,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 172,
"computed": false,
"end": 0,
"object": {
"commentStart": 172,
"end": 0,
"name": "new_arr1",
"start": 0,
@ -271,6 +308,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "Identifier"
},
"property": {
"commentStart": 181,
"end": 0,
"raw": "1",
"start": 0,
@ -286,6 +324,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "MemberExpression"
},
{
"commentStart": 185,
"end": 0,
"raw": "2",
"start": 0,
@ -297,6 +336,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 188,
"end": 0,
"raw": "0.00001",
"start": 0,
@ -308,6 +348,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 197,
"end": 0,
"raw": "\"element 1 should not have changed\"",
"start": 0,
@ -317,11 +358,13 @@ description: Result of parsing array_elem_pop.kcl
}
],
"callee": {
"commentStart": 160,
"end": 0,
"name": "assertEqual",
"start": 0,
"type": "Identifier"
},
"commentStart": 160,
"end": 0,
"start": 0,
"type": "CallExpression",
@ -332,13 +375,16 @@ description: Result of parsing array_elem_pop.kcl
"type": "ExpressionStatement"
},
{
"commentStart": 234,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 246,
"computed": false,
"end": 0,
"object": {
"commentStart": 246,
"end": 0,
"name": "new_arr2",
"start": 0,
@ -346,6 +392,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "Identifier"
},
"property": {
"commentStart": 255,
"end": 0,
"raw": "0",
"start": 0,
@ -361,6 +408,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "MemberExpression"
},
{
"commentStart": 259,
"end": 0,
"raw": "1",
"start": 0,
@ -372,6 +420,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 262,
"end": 0,
"raw": "0.00001",
"start": 0,
@ -383,6 +432,7 @@ description: Result of parsing array_elem_pop.kcl
}
},
{
"commentStart": 271,
"end": 0,
"raw": "\"element 0 should not have changed\"",
"start": 0,
@ -392,11 +442,13 @@ description: Result of parsing array_elem_pop.kcl
}
],
"callee": {
"commentStart": 234,
"end": 0,
"name": "assertEqual",
"start": 0,
"type": "Identifier"
},
"commentStart": 234,
"end": 0,
"start": 0,
"type": "CallExpression",
@ -407,6 +459,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "ExpressionStatement"
}
],
"commentStart": 0,
"end": 0,
"start": 0
}