File: statement.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.36.33-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 163,900 kB
  • sloc: makefile: 182
file content (35 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package ini

// Statement is an empty AST mostly used for transitioning states.
func newStatement() AST {
	return newAST(ASTKindStatement, AST{})
}

// SectionStatement represents a section AST
func newSectionStatement(tok Token) AST {
	return newASTWithRootToken(ASTKindSectionStatement, tok)
}

// ExprStatement represents a completed expression AST
func newExprStatement(ast AST) AST {
	return newAST(ASTKindExprStatement, ast)
}

// CommentStatement represents a comment in the ini definition.
//
//	grammar:
//	comment -> #comment' | ;comment'
//	comment' -> epsilon | value
func newCommentStatement(tok Token) AST {
	return newAST(ASTKindCommentStatement, newExpression(tok))
}

// CompletedSectionStatement represents a completed section
func newCompletedSectionStatement(ast AST) AST {
	return newAST(ASTKindCompletedSectionStatement, ast)
}

// SkipStatement is used to skip whole statements
func newSkipStatement(ast AST) AST {
	return newAST(ASTKindSkipStatement, ast)
}