@@ -964,7 +964,7 @@ ClassDeclaration // {{{
964964 $$ = location ({
965965 kind: Kind .ClassDeclaration ,
966966 modifiers: $1 ,
967- name: $2 ,
967+ name: $3 ,
968968 extends: $6 ,
969969 members: $8
970970 }, @1 , @9 );
@@ -1002,7 +1002,7 @@ ClassDeclaration // {{{
10021002 $$ = location ({
10031003 kind: Kind .ClassDeclaration ,
10041004 modifiers: [],
1005- name: $1 ,
1005+ name: $2 ,
10061006 extends: $5 ,
10071007 members: $7
10081008 }, @1 , @8 );
@@ -1169,7 +1169,17 @@ ClassMemberModifier // {{{
11691169// }}}
11701170
11711171ClassMemberSX // {{{
1172- : ClassField
1172+ : AttributeList ClassField
1173+ {
1174+ $$ = location ($2 , @1 , @2 );
1175+ $$ .attributes = $1 ;
1176+ }
1177+ | AttributeList Method
1178+ {
1179+ $$ = location ($2 , @1 , @2 );
1180+ $$ .attributes = $1 ;
1181+ }
1182+ | ClassField
11731183 | Method
11741184 ;
11751185// }}}
@@ -1185,7 +1195,7 @@ ClassModifier // {{{
11851195 {
11861196 $$ = [
11871197 location ({
1188- kind: ClassModifier .Sealed
1198+ kind: ClassModifier .Sealed
11891199 }, @1 ),
11901200 location ({
11911201 kind: ClassModifier .Abstract
@@ -1705,74 +1715,120 @@ ExternDeclarator // {{{
17051715// }}}
17061716
17071717ExternClass // {{{
1708- : 'SEALED' 'CLASS' Identifier TypeGeneric '{' ExternClassMember '}'
1718+ : 'SEALED' 'ABSTRACT' 'CLASS' ExternClassBody
17091719 {
1710- $$ = location ({
1711- kind: Kind .ClassDeclaration ,
1712- name: $3 ,
1713- members: $6 ,
1714- sealed: true
1715- }, @1 , @7 );
1720+ $4 .modifiers = [
1721+ location ({
1722+ kind: ClassModifier .Sealed
1723+ }, @1 ),
1724+ location ({
1725+ kind: ClassModifier .Abstract
1726+ }, @2 )
1727+ ];
1728+
1729+ $$ = location ($4 , @1 , @4 );
1730+ }
1731+ | 'ABSTRACT' 'CLASS' ExternClassBody
1732+ {
1733+ $3 .modifiers = [
1734+ location ({
1735+ kind: ClassModifier .Abstract
1736+ }, @1 )
1737+ ];
1738+
1739+ $$ = location ($3 , @1 , @3 );
1740+ }
1741+ | 'SEALED' 'CLASS' ExternClassBody
1742+ {
1743+ $3 .modifiers = [
1744+ location ({
1745+ kind: ClassModifier .Sealed
1746+ }, @1 )
1747+ ];
1748+
1749+ $$ = location ($3 , @1 , @3 );
17161750 }
1717- | 'SEALED' 'CLASS' Identifier '{' ExternClassMember '}'
1751+ | 'CLASS' ExternClassBody
1752+ {
1753+ $2 .modifiers = [];
1754+
1755+ $$ = location ($2 , @1 , @2 );
1756+ }
1757+ ;
1758+ // }}}
1759+
1760+ ExternClassBody // {{{
1761+ : Identifier TypeGeneric 'EXTENDS' Identifier '{' ExternClassMember '}'
17181762 {
17191763 $$ = location ({
17201764 kind: Kind .ClassDeclaration ,
1721- name: $3 ,
1722- members : $5 ,
1723- sealed : true
1724- }, @1 , @6 );
1765+ name: $1 ,
1766+ extends : $4 ,
1767+ members : $6
1768+ }, @1 , @7 );
17251769 }
1726- | 'CLASS ' Identifier TypeGeneric '{' ExternClassMember '}'
1770+ | Identifier 'EXTENDS ' Identifier '{' ExternClassMember '}'
17271771 {
17281772 $$ = location ({
17291773 kind: Kind .ClassDeclaration ,
1730- name: $2 ,
1774+ modifiers: [],
1775+ name: $1 ,
1776+ extends: $3 ,
17311777 members: $5
17321778 }, @1 , @6 );
17331779 }
1734- | 'CLASS' Identifier '{' ExternClassMember '}'
1780+ | Identifier TypeGeneric '{' ExternClassMember '}'
17351781 {
17361782 $$ = location ({
17371783 kind: Kind .ClassDeclaration ,
1738- name: $2 ,
1784+ modifiers: [],
1785+ name: $1 ,
17391786 members: $4
17401787 }, @1 , @5 );
17411788 }
1742- | 'SEALED' 'CLASS' Identifier TypeGeneric
1789+ | Identifier '{' ExternClassMember '}'
17431790 {
17441791 $$ = location ({
17451792 kind: Kind .ClassDeclaration ,
1746- name : $3 ,
1747- members : [] ,
1748- sealed : true
1793+ modifiers : [] ,
1794+ name : $1 ,
1795+ members : $3
17491796 }, @1 , @4 );
17501797 }
1751- | 'SEALED' 'CLASS ' Identifier
1798+ | Identifier TypeGeneric 'EXTENDS ' Identifier
17521799 {
17531800 $$ = location ({
17541801 kind: Kind .ClassDeclaration ,
1755- name: $3 ,
1756- members : [] ,
1757- sealed : true
1758- }, @1 , @3 );
1802+ name: $1 ,
1803+ extends : $4 ,
1804+ members : []
1805+ }, @1 , @7 );
17591806 }
1760- | 'CLASS ' Identifier TypeGeneric
1807+ | Identifier 'EXTENDS ' Identifier
17611808 {
17621809 $$ = location ({
17631810 kind: Kind .ClassDeclaration ,
1764- name: $2 ,
1811+ name: $1 ,
1812+ extends: $3 ,
17651813 members: []
17661814 }, @1 , @3 );
17671815 }
1768- | 'CLASS' Identifier
1816+ | Identifier TypeGeneric
17691817 {
17701818 $$ = location ({
17711819 kind: Kind .ClassDeclaration ,
1772- name: $2 ,
1820+ name: $1 ,
17731821 members: []
17741822 }, @1 , @2 );
17751823 }
1824+ | Identifier
1825+ {
1826+ $$ = location ({
1827+ kind: Kind .ClassDeclaration ,
1828+ name: $1 ,
1829+ members: []
1830+ }, @1 );
1831+ }
17761832 ;
17771833// }}}
17781834
@@ -3630,7 +3686,17 @@ ObjectListPN // {{{
36303686// }}}
36313687
36323688ObjectListPNI // {{{
3633- : ObjectItem ',' NL_0M
3689+ : AttributeList ObjectItem ',' NL_0M
3690+ {
3691+ $$ = location ($2 , @1 , @2 );
3692+ $$ .attributes = $1 ;
3693+ }
3694+ | AttributeList ObjectItem NL_1M
3695+ {
3696+ $$ = location ($2 , @1 , @2 );
3697+ $$ .attributes = $1 ;
3698+ }
3699+ | ObjectItem ',' NL_0M
36343700 | ObjectItem NL_1M
36353701 ;
36363702// }}}
0 commit comments