diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 6fd54bc..f79c8e7 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -532,7 +532,6 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { if nn.Variadic { io.WriteString(p.w, "...") } - p.printFreeFloating(nn, token.Variadic) p.Print(nn.Expr) @@ -1916,7 +1915,6 @@ func (p *Printer) printExprVariable(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - p.printFreeFloating(nn, token.Dollar) if _, ok := nn.VarName.(*ast.Identifier); !ok { io.WriteString(p.w, "$") } @@ -2313,7 +2311,6 @@ func (p *Printer) printStmtClass(n ast.Vertex) { } p.printFreeFloating(nn, token.ModifierList) io.WriteString(p.w, "class") - p.printFreeFloating(nn, token.Class) if nn.ClassName != nil { p.bufStart = " " diff --git a/pkg/token/position.go b/pkg/token/position.go index 28f7802..c74e558 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -8,15 +8,11 @@ const ( End SemiColon AltEnd - Dollar Ampersand Name - Prefix Key Var - UseType ReturnType - OptionalType CaseSeparator LexicalVars Params @@ -37,7 +33,6 @@ const ( While For Switch - Break Foreach Declare Label @@ -47,11 +42,8 @@ const ( If ElseIf Else - Variadic Function - DoubleArrow Alias - As Equal Exit Array @@ -77,7 +69,6 @@ const ( ParameterList AdaptationList LexicalVarList - UseDeclarationList OpenParenthesisToken CloseParenthesisToken diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go index ef682f8..c3c6eab 100644 --- a/pkg/token/position_string.go +++ b/pkg/token/position_string.go @@ -12,81 +12,72 @@ func _() { _ = x[End-1] _ = x[SemiColon-2] _ = x[AltEnd-3] - _ = x[Dollar-4] - _ = x[Ampersand-5] - _ = x[Name-6] - _ = x[Prefix-7] - _ = x[Key-8] - _ = x[Var-9] - _ = x[UseType-10] - _ = x[ReturnType-11] - _ = x[OptionalType-12] - _ = x[CaseSeparator-13] - _ = x[LexicalVars-14] - _ = x[Params-15] - _ = x[Ref-16] - _ = x[Cast-17] - _ = x[Expr-18] - _ = x[InitExpr-19] - _ = x[CondExpr-20] - _ = x[IncExpr-21] - _ = x[True-22] - _ = x[Cond-23] - _ = x[HaltCompiller-24] - _ = x[Namespace-25] - _ = x[Static-26] - _ = x[Class-27] - _ = x[Use-28] - _ = x[While-29] - _ = x[For-30] - _ = x[Switch-31] - _ = x[Break-32] - _ = x[Foreach-33] - _ = x[Declare-34] - _ = x[Label-35] - _ = x[Finally-36] - _ = x[List-37] - _ = x[Default-38] - _ = x[If-39] - _ = x[ElseIf-40] - _ = x[Else-41] - _ = x[Variadic-42] - _ = x[Function-43] - _ = x[DoubleArrow-44] - _ = x[Alias-45] - _ = x[As-46] - _ = x[Equal-47] - _ = x[Exit-48] - _ = x[Array-49] - _ = x[Isset-50] - _ = x[Empty-51] - _ = x[Eval-52] - _ = x[Echo-53] - _ = x[Try-54] - _ = x[Catch-55] - _ = x[Unset-56] - _ = x[Stmts-57] - _ = x[VarList-58] - _ = x[ConstList-59] - _ = x[NameList-60] - _ = x[ParamList-61] - _ = x[ModifierList-62] - _ = x[ArrayPairList-63] - _ = x[CaseListStart-64] - _ = x[CaseListEnd-65] - _ = x[ArgumentList-66] - _ = x[PropertyList-67] - _ = x[ParameterList-68] - _ = x[AdaptationList-69] - _ = x[LexicalVarList-70] - _ = x[UseDeclarationList-71] - _ = x[OpenParenthesisToken-72] - _ = x[CloseParenthesisToken-73] + _ = x[Ampersand-4] + _ = x[Name-5] + _ = x[Key-6] + _ = x[Var-7] + _ = x[ReturnType-8] + _ = x[CaseSeparator-9] + _ = x[LexicalVars-10] + _ = x[Params-11] + _ = x[Ref-12] + _ = x[Cast-13] + _ = x[Expr-14] + _ = x[InitExpr-15] + _ = x[CondExpr-16] + _ = x[IncExpr-17] + _ = x[True-18] + _ = x[Cond-19] + _ = x[HaltCompiller-20] + _ = x[Namespace-21] + _ = x[Static-22] + _ = x[Class-23] + _ = x[Use-24] + _ = x[While-25] + _ = x[For-26] + _ = x[Switch-27] + _ = x[Foreach-28] + _ = x[Declare-29] + _ = x[Label-30] + _ = x[Finally-31] + _ = x[List-32] + _ = x[Default-33] + _ = x[If-34] + _ = x[ElseIf-35] + _ = x[Else-36] + _ = x[Function-37] + _ = x[Alias-38] + _ = x[Equal-39] + _ = x[Exit-40] + _ = x[Array-41] + _ = x[Isset-42] + _ = x[Empty-43] + _ = x[Eval-44] + _ = x[Echo-45] + _ = x[Try-46] + _ = x[Catch-47] + _ = x[Unset-48] + _ = x[Stmts-49] + _ = x[VarList-50] + _ = x[ConstList-51] + _ = x[NameList-52] + _ = x[ParamList-53] + _ = x[ModifierList-54] + _ = x[ArrayPairList-55] + _ = x[CaseListStart-56] + _ = x[CaseListEnd-57] + _ = x[ArgumentList-58] + _ = x[PropertyList-59] + _ = x[ParameterList-60] + _ = x[AdaptationList-61] + _ = x[LexicalVarList-62] + _ = x[OpenParenthesisToken-63] + _ = x[CloseParenthesisToken-64] } -const _Position_name = "StartEndSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" +const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchForeachDeclareLabelFinallyListDefaultIfElseIfElseFunctionAliasEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListOpenParenthesisTokenCloseParenthesisToken" -var _Position_index = [...]uint16{0, 5, 8, 17, 23, 29, 38, 42, 48, 51, 54, 61, 71, 83, 96, 107, 113, 116, 120, 124, 132, 140, 147, 151, 155, 168, 177, 183, 188, 191, 196, 199, 205, 210, 217, 224, 229, 236, 240, 247, 249, 255, 259, 267, 275, 286, 291, 293, 298, 302, 307, 312, 317, 321, 325, 328, 333, 338, 343, 350, 359, 367, 376, 388, 401, 414, 425, 437, 449, 462, 476, 490, 508, 528, 549} +var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 137, 146, 152, 157, 160, 165, 168, 174, 181, 188, 193, 200, 204, 211, 213, 219, 223, 231, 236, 241, 245, 250, 255, 260, 264, 268, 271, 276, 281, 286, 293, 302, 310, 319, 331, 344, 357, 368, 380, 392, 405, 419, 433, 453, 474} func (i Position) String() string { if i < 0 || i >= Position(len(_Position_index)-1) {