[refactoring] update ast structure of "Nullable"
This commit is contained in:
		
							parent
							
								
									bf3ae74d56
								
							
						
					
					
						commit
						43ace92875
					
				
							
								
								
									
										1040
									
								
								internal/php5/php5.go
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1040
									
								
								internal/php5/php5.go
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1000
									
								
								internal/php7/php7.go
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1000
									
								
								internal/php7/php7.go
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1948,13 +1948,13 @@ type_expr: | ||||
|             } | ||||
|     |   '?' type | ||||
|             { | ||||
|                 $$ = &ast.Nullable{ast.Node{}, $2} | ||||
| 
 | ||||
|                 // save position | ||||
|                 $$.GetNode().Position = position.NewTokenNodePosition($1, $2) | ||||
| 
 | ||||
|                 // save comments | ||||
|                 yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) | ||||
|                 $$ = &ast.Nullable{ | ||||
|                     Node: ast.Node{ | ||||
|                         Position: position.NewTokenNodePosition($1, $2), | ||||
|                     }, | ||||
|                     QuestionTkn: $1, | ||||
|                     Expr:        $2, | ||||
|                 } | ||||
|             } | ||||
| ; | ||||
| 
 | ||||
|  | ||||
| @ -33,7 +33,8 @@ func (n *Root) Accept(v NodeVisitor) { | ||||
| // Nullable node | ||||
| type Nullable struct { | ||||
| 	Node | ||||
| 	Expr Vertex | ||||
| 	QuestionTkn *token.Token | ||||
| 	Expr        Vertex | ||||
| } | ||||
| 
 | ||||
| func (n *Nullable) Accept(v NodeVisitor) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user