3 // Statement is an empty AST mostly used for transitioning states.
4 func newStatement() AST {
5 return newAST(ASTKindStatement, AST{})
8 // SectionStatement represents a section AST
9 func newSectionStatement(tok Token) AST {
10 return newASTWithRootToken(ASTKindSectionStatement, tok)
13 // ExprStatement represents a completed expression AST
14 func newExprStatement(ast AST) AST {
15 return newAST(ASTKindExprStatement, ast)
18 // CommentStatement represents a comment in the ini definition.
21 // comment -> #comment' | ;comment'
22 // comment' -> epsilon | value
23 func newCommentStatement(tok Token) AST {
24 return newAST(ASTKindCommentStatement, newExpression(tok))
27 // CompletedSectionStatement represents a completed section
28 func newCompletedSectionStatement(ast AST) AST {
29 return newAST(ASTKindCompletedSectionStatement, ast)
32 // SkipStatement is used to skip whole statements
33 func newSkipStatement(ast AST) AST {
34 return newAST(ASTKindSkipStatement, ast)