File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -657,12 +657,31 @@ Arguments
657
657
= "(" __ args :(ArgumentList __ )? ")" {
658
658
return optionalList (extractOptional (args, 0 ));
659
659
}
660
+ / "(" __ "{" __ args :(NameValueList __ )? "}" __ ")" {
661
+ return optionalList (extractOptional (args, 0 ));
662
+ }
660
663
661
664
ArgumentList
662
665
= head :AssignmentExpression tail :(__ "," __ AssignmentExpression )* {
663
666
return buildList (head, tail, 3 );
664
667
}
665
668
669
+ NameValueList
670
+ = head :NameValueAssignment tail :(__ "," __ NameValueAssignment )* {
671
+ return buildList (head, tail, 3 );
672
+ }
673
+
674
+ NameValueAssignment
675
+ = name :Identifier __ ":" __ value :AssignmentExpression __ {
676
+ return {
677
+ type: " NameValueAssignment" ,
678
+ name: name,
679
+ value: value,
680
+ start: location ().start .offset ,
681
+ end: location ().end .offset
682
+ };
683
+ }
684
+
666
685
LeftHandSideExpression
667
686
= DeclarativeExpression
668
687
/ CallExpression
Original file line number Diff line number Diff line change @@ -366,3 +366,22 @@ contract TypeIndexSpacing {
366
366
uint [ 7 ] x;
367
367
uint [] y;
368
368
}
369
+
370
+ contract Ballot {
371
+
372
+ struct Voter {
373
+ uint weight;
374
+ bool voted;
375
+ }
376
+
377
+ function abstain () returns (bool ) {
378
+ return false ;
379
+ }
380
+
381
+ Voter you = Voter (1 , true );
382
+
383
+ Voter me = Voter ({
384
+ weight: 2 ,
385
+ voted: abstain ()
386
+ });
387
+ }
You can’t perform that action at this time.
0 commit comments