File tree Expand file tree Collapse file tree 3 files changed +150
-1
lines changed Expand file tree Collapse file tree 3 files changed +150
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ module.exports = {
39
39
case "~" :
40
40
case "<" :
41
41
case ">" :
42
+ case "!" :
42
43
return this . consume_TOKEN ( ) ;
43
44
case "[" :
44
45
listDepth ++ ;
@@ -67,7 +68,7 @@ module.exports = {
67
68
break ;
68
69
}
69
70
}
70
- return this . tok . T_STRING ;
71
+ return this . T_STRING ( ) ;
71
72
} else if ( this . is_NUM ( ) ) {
72
73
return this . consume_NUM ( ) ;
73
74
}
Original file line number Diff line number Diff line change @@ -1269,6 +1269,150 @@ Program {
1269
1269
],
1270
1270
" kind" : " attrgroup" ,
1271
1271
},
1272
+ AttrGroup {
1273
+ " attrs" : Array [
1274
+ Attribute {
1275
+ " args" : Array [
1276
+ Bin {
1277
+ " kind" : " bin" ,
1278
+ " left" : StaticLookup {
1279
+ " kind" : " staticlookup" ,
1280
+ " offset" : Identifier {
1281
+ " kind" : " identifier" ,
1282
+ " name" : " FOO" ,
1283
+ },
1284
+ " what" : Name {
1285
+ " kind" : " name" ,
1286
+ " name" : " Att3" ,
1287
+ " resolution" : " uqn" ,
1288
+ },
1289
+ },
1290
+ " right" : StaticLookup {
1291
+ " kind" : " staticlookup" ,
1292
+ " offset" : Identifier {
1293
+ " kind" : " identifier" ,
1294
+ " name" : " BAR" ,
1295
+ },
1296
+ " what" : Name {
1297
+ " kind" : " name" ,
1298
+ " name" : " Att3" ,
1299
+ " resolution" : " uqn" ,
1300
+ },
1301
+ },
1302
+ " type" : " or" ,
1303
+ },
1304
+ ],
1305
+ " kind" : " attribute" ,
1306
+ " name" : " Att3" ,
1307
+ },
1308
+ ],
1309
+ " kind" : " attrgroup" ,
1310
+ },
1311
+ AttrGroup {
1312
+ " attrs" : Array [
1313
+ Attribute {
1314
+ " args" : Array [
1315
+ Bin {
1316
+ " kind" : " bin" ,
1317
+ " left" : StaticLookup {
1318
+ " kind" : " staticlookup" ,
1319
+ " offset" : Identifier {
1320
+ " kind" : " identifier" ,
1321
+ " name" : " FOO" ,
1322
+ },
1323
+ " what" : Name {
1324
+ " kind" : " name" ,
1325
+ " name" : " Att4" ,
1326
+ " resolution" : " uqn" ,
1327
+ },
1328
+ },
1329
+ " right" : StaticLookup {
1330
+ " kind" : " staticlookup" ,
1331
+ " offset" : Identifier {
1332
+ " kind" : " identifier" ,
1333
+ " name" : " BAR" ,
1334
+ },
1335
+ " what" : Name {
1336
+ " kind" : " name" ,
1337
+ " name" : " Att4" ,
1338
+ " resolution" : " uqn" ,
1339
+ },
1340
+ },
1341
+ " type" : " and" ,
1342
+ },
1343
+ ],
1344
+ " kind" : " attribute" ,
1345
+ " name" : " Att4" ,
1346
+ },
1347
+ ],
1348
+ " kind" : " attrgroup" ,
1349
+ },
1350
+ AttrGroup {
1351
+ " attrs" : Array [
1352
+ Attribute {
1353
+ " args" : Array [
1354
+ Bin {
1355
+ " kind" : " bin" ,
1356
+ " left" : StaticLookup {
1357
+ " kind" : " staticlookup" ,
1358
+ " offset" : Identifier {
1359
+ " kind" : " identifier" ,
1360
+ " name" : " FOO" ,
1361
+ },
1362
+ " what" : Name {
1363
+ " kind" : " name" ,
1364
+ " name" : " Att5" ,
1365
+ " resolution" : " uqn" ,
1366
+ },
1367
+ },
1368
+ " right" : StaticLookup {
1369
+ " kind" : " staticlookup" ,
1370
+ " offset" : Identifier {
1371
+ " kind" : " identifier" ,
1372
+ " name" : " BAR" ,
1373
+ },
1374
+ " what" : Name {
1375
+ " kind" : " name" ,
1376
+ " name" : " Att5" ,
1377
+ " resolution" : " uqn" ,
1378
+ },
1379
+ },
1380
+ " type" : " xor" ,
1381
+ },
1382
+ ],
1383
+ " kind" : " attribute" ,
1384
+ " name" : " Att5" ,
1385
+ },
1386
+ ],
1387
+ " kind" : " attrgroup" ,
1388
+ },
1389
+ AttrGroup {
1390
+ " attrs" : Array [
1391
+ Attribute {
1392
+ " args" : Array [
1393
+ Unary {
1394
+ " kind" : " unary" ,
1395
+ " type" : " !" ,
1396
+ " what" : StaticLookup {
1397
+ " kind" : " staticlookup" ,
1398
+ " offset" : Identifier {
1399
+ " kind" : " identifier" ,
1400
+ " name" : " FOO" ,
1401
+ },
1402
+ " what" : Name {
1403
+ " kind" : " name" ,
1404
+ " name" : " Att6" ,
1405
+ " resolution" : " uqn" ,
1406
+ },
1407
+ },
1408
+ },
1409
+ ],
1410
+ " kind" : " attribute" ,
1411
+ " name" : " Att6" ,
1412
+ },
1413
+ ],
1414
+ " kind" : " attrgroup" ,
1415
+ },
1272
1416
],
1273
1417
" body" : Array [],
1274
1418
" extends" : null ,
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ describe("Parse Attributes", () => {
98
98
`
99
99
#[Att1(Att1::FOO || Att1::BAR)]
100
100
#[Att2(Att2::FOO && Att2::BAR)]
101
+ #[Att3(Att3::FOO or Att3::BAR)]
102
+ #[Att4(Att4::FOO and Att4::BAR)]
103
+ #[Att5(Att5::FOO xor Att5::BAR)]
104
+ #[Att6(!Att6::FOO)]
101
105
class A {}
102
106
` ,
103
107
{ parser : { extractDoc : true } }
You can’t perform that action at this time.
0 commit comments