aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go')
-rw-r--r--vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go
new file mode 100644
index 0000000..eef8b96
--- /dev/null
+++ b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go
@@ -0,0 +1,21 @@
1package hclsyntax
2
3import (
4 "bytes"
5)
6
7type Keyword []byte
8
9var forKeyword = Keyword([]byte{'f', 'o', 'r'})
10var inKeyword = Keyword([]byte{'i', 'n'})
11var ifKeyword = Keyword([]byte{'i', 'f'})
12var elseKeyword = Keyword([]byte{'e', 'l', 's', 'e'})
13var endifKeyword = Keyword([]byte{'e', 'n', 'd', 'i', 'f'})
14var endforKeyword = Keyword([]byte{'e', 'n', 'd', 'f', 'o', 'r'})
15
16func (kw Keyword) TokenMatches(token Token) bool {
17 if token.Type != TokenIdent {
18 return false
19 }
20 return bytes.Equal([]byte(kw), token.Bytes)
21}