create ForInitSemicolonToken and ForCondSemicolonToken comment anchors

This commit is contained in:
z7zmey 2018-06-03 12:50:08 +03:00
parent 6ccca996a8
commit 22cca215df
3 changed files with 8 additions and 4 deletions

View File

@ -22,6 +22,8 @@ const (
DoToken
WhileToken
EndwhileToken
ForInitSemicolonToken
ForCondSemicolonToken
ForToken
EndforToken
ForeachToken
@ -182,6 +184,8 @@ var TokenNames = map[TokenName]string{
DoToken: "DoToken",
WhileToken: "WhileToken",
EndwhileToken: "EndwhileToken",
ForInitSemicolonToken: "ForInitSemicolonToken",
ForCondSemicolonToken: "ForCondSemicolonToken",
ForToken: "ForToken",
EndforToken: "EndforToken",
ForeachToken: "ForeachToken",

View File

@ -3194,8 +3194,8 @@ yydefault:
// save comments
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken)
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken)
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken)
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken)
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ForInitSemicolonToken)
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.ForCondSemicolonToken)
yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken)
}
case 137:

View File

@ -832,8 +832,8 @@ statement:
// save comments
yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken)
yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken)
yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken)
yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken)
yylex.(*Parser).comments.AddFromToken($$, $4, comment.ForInitSemicolonToken)
yylex.(*Parser).comments.AddFromToken($$, $6, comment.ForCondSemicolonToken)
yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken)
}
| T_SWITCH '(' expr ')' switch_case_list