aboutsummaryrefslogtreecommitdiff
path: root/engine/event.go
blob: 18f9eb2f78ddff288cad7ff492880a40134227a2 (plain) (blame)
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
package engine

import "strings"

type LineEvent struct {
	Content        string
	TrimmedContent string
	StatementType  string
	IsTopLevel     bool
	IsScoped       bool
	IsStartLine    bool
	HasASTInfo     bool
	IsClosingBrace bool
	IsOpeningBrace bool
	IsCaseLabel    bool
	IsContinuation bool
	IsCommentOnly  bool
	IsBlank        bool
	InRawString    bool
	IsPackageDecl  bool
}

func NewLineEvent(content string) LineEvent {
	trimmed := strings.TrimSpace(content)

	return LineEvent{
		Content:        content,
		TrimmedContent: trimmed,
		IsBlank:        trimmed == "",
	}
}