@@ -121,6 +121,10 @@ private Statement statement()
121121 {
122122 return new FunctionStatement ( function ( ) ) ;
123123 }
124+ else if ( get ( 0 ) . getType ( ) == TokenType . WORD && get ( 1 ) . getType ( ) == TokenType . DDOT && get ( 2 ) . getType ( ) == TokenType . WORD && get ( 3 ) . getType ( ) == TokenType . LPAREN )
125+ {
126+ return new FunctionStatement ( function ( ) ) ;
127+ }
124128 if ( get ( 0 ) . getType ( ) == TokenType . RUN_CLASS && get ( 1 ) . getType ( ) == TokenType . WORD && get ( 2 ) . getType ( ) == TokenType . LPAREN )
125129 {
126130 return new ClassStatement ( classes ( ) ) ;
@@ -175,7 +179,7 @@ private Statement switchs()
175179 private Statement enums ( )
176180 {
177181 string name = consume ( TokenType . WORD ) . getText ( ) ;
178- Dictionary < string , StringValue > enums = new Dictionary < string , StringValue > ( ) ;
182+ Dictionary < string , Value > enums = new Dictionary < string , Value > ( ) ;
179183
180184 consume ( TokenType . LBRACE ) ;
181185 while ( ! ( match ( TokenType . RBRACE ) ) )
@@ -198,6 +202,15 @@ private Statement assignmentStatement()
198202 return new AssignmentStatement ( variable , expression ( ) ) ;
199203 }
200204
205+ if ( current . getType ( ) == TokenType . WORD && get ( 1 ) . getType ( ) == TokenType . WORD && get ( 2 ) . getType ( ) == TokenType . DDOTEQ )
206+ {
207+ string enums = consume ( TokenType . WORD ) . getText ( ) ;
208+ string variable = consume ( TokenType . WORD ) . getText ( ) ;
209+ consume ( TokenType . DDOTEQ ) ;
210+ DdotEqAssignmentStatement ddotEq = new DdotEqAssignmentStatement ( ( EnumValue ) Variables . get ( enums ) , new StringValue ( variable ) , expression ( ) . eval ( ) ) ;
211+ return ddotEq ;
212+ }
213+
201214 if ( current . getType ( ) == TokenType . WORD && get ( 1 ) . getType ( ) == TokenType . PLUSEQ )
202215 {
203216 string variable = consume ( TokenType . WORD ) . getText ( ) ;
@@ -581,6 +594,10 @@ private Expression primary()
581594 {
582595 return lambda ( ) ;
583596 }
597+ if ( get ( 0 ) . getType ( ) == TokenType . WORD && get ( 1 ) . getType ( ) == TokenType . DDOT && get ( 2 ) . getType ( ) == TokenType . WORD && get ( 3 ) . getType ( ) == TokenType . LPAREN )
598+ {
599+ return function ( ) ;
600+ }
584601 if ( lookMatch ( 0 , TokenType . WORD ) && lookMatch ( 1 , TokenType . LPAREN ) )
585602 {
586603 return function ( ) ;
@@ -675,6 +692,20 @@ private LdefExpression ldef()
675692 private FunctionalExpression function ( )
676693 {
677694 string name = consume ( TokenType . WORD ) . getText ( ) ;
695+ if ( lookMatch ( 0 , TokenType . DDOT ) )
696+ {
697+ consume ( TokenType . DDOT ) ;
698+ string valname = consume ( TokenType . WORD ) . getText ( ) ;
699+ consume ( TokenType . LPAREN ) ;
700+ FunctionalExpression efunction = new FunctionalExpression ( valname ) ;
701+ efunction . enumFunc = name ;
702+ while ( ! match ( TokenType . RPAREN ) )
703+ {
704+ efunction . addArgument ( expression ( ) ) ;
705+ match ( TokenType . COMMA ) ;
706+ }
707+ return efunction ;
708+ }
678709 consume ( TokenType . LPAREN ) ;
679710 FunctionalExpression function = new FunctionalExpression ( name ) ;
680711 while ( ! match ( TokenType . RPAREN ) )
0 commit comments