@@ -117,7 +117,7 @@ export default class Parser {
117117 Type : 'variable' ,
118118 Name : groupName ,
119119 IsChoiceAddition : isChoiceAddition ,
120- PropertyType : this . parsePropertyTypes ( ) ,
120+ PropertyType : this . parsePropertyTypes ( true ) ,
121121 Comments : [ ]
122122 }
123123
@@ -148,7 +148,7 @@ export default class Parser {
148148 ) {
149149 const propertyType : PropertyType [ ] = [ ]
150150 while ( ! closingTokens . includes ( this . curToken . Type ) ) {
151- propertyType . push ( ...this . parsePropertyTypes ( ) )
151+ propertyType . push ( ...this . parsePropertyTypes ( true ) )
152152 if ( closingTokens . includes ( this . curToken . Type ) ) {
153153 this . nextToken ( )
154154 break
@@ -820,7 +820,7 @@ export default class Parser {
820820 return this . curToken . Literal === Tokens . DOT && OPERATORS . includes ( this . peekToken . Literal as OperatorType )
821821 }
822822
823- private parsePropertyTypes ( ) : PropertyType [ ] {
823+ private parsePropertyTypes ( attachChoiceOperators = false ) : PropertyType [ ] {
824824 const propertyTypes : PropertyType [ ] = [ ]
825825
826826 let prop : PropertyType = this . parsePropertyType ( )
@@ -870,14 +870,22 @@ export default class Parser {
870870 while ( [ Tokens . COMMENT ] . includes ( this . curToken . Type ) ) {
871871 this . parseComment ( )
872872 }
873- propertyTypes . push ( this . parsePropertyType ( ) )
874- if ( ! this . isOperator ( ) && this . curToken . Type !== Tokens . SLASH ) {
873+ let nextProp : PropertyType = this . parsePropertyType ( )
874+ if ( this . isOperator ( ) ) {
875+ if ( attachChoiceOperators ) {
876+ nextProp = {
877+ Type : nextProp ,
878+ Operator : this . parseOperator ( )
879+ } as NativeTypeWithOperator
880+ }
881+ } else if ( this . curToken . Type !== Tokens . SLASH ) {
875882 /**
876883 * If we are not parsing an operator, we need to eat the next token;
877884 * otherwise, the operator will be parsed by the caller
878885 */
879886 this . nextToken ( )
880887 }
888+ propertyTypes . push ( nextProp )
881889
882890 while ( [ Tokens . COMMENT ] . includes ( this . curToken . Type ) && this . peekToken . Type === Tokens . SLASH ) {
883891 this . parseComment ( )
0 commit comments