php8.1: added intersection types support (#29)

This commit is contained in:
Makhnev Petr
2022-06-26 03:31:29 +03:00
committed by GitHub
parent 7f6cd25376
commit e16671724e
21 changed files with 22940 additions and 22127 deletions

View File

@@ -237,6 +237,12 @@ func (f *formatter) Union(n *ast.Union) {
}
}
func (f *formatter) Intersection(n *ast.Intersection) {
if len(n.Types) > 0 {
n.SeparatorTkns = f.formatList(n.Types, '&')
}
}
func (f *formatter) Attribute(n *ast.Attribute) {
n.Name.Accept(f)
n.OpenParenthesisTkn = f.newToken('(', []byte("("))