summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile/lexer.go
diff options
context:
space:
mode:
authorMohammed Al Sahaf <msaa1990@gmail.com>2021-04-09 18:06:25 +0000
committerGitHub <noreply@github.com>2021-04-09 12:06:25 -0600
commit3903642aa7cf711cb20f27958e7ee5b15fe2bbb3 (patch)
treee858bd4db5126f5c3ae4f47ce4e7793c88a464e6 /caddyconfig/caddyfile/lexer.go
parent03b5debd958a324d5c00cc37f887130b0198e747 (diff)
caddyfile: reject cyclic imports (#4022)
* caddyfile: reject recursive self-imports * caddyfile: detect and reject cyclic imports of snippets and files * caddyfile: do not be stickler about connected nodes not being connected already * caddyfile: include missing test artifacts of cyclic imports * address review comments
Diffstat (limited to 'caddyconfig/caddyfile/lexer.go')
-rwxr-xr-xcaddyconfig/caddyfile/lexer.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/caddyconfig/caddyfile/lexer.go b/caddyconfig/caddyfile/lexer.go
index 188ef06..f4da239 100755
--- a/caddyconfig/caddyfile/lexer.go
+++ b/caddyconfig/caddyfile/lexer.go
@@ -35,9 +35,11 @@ type (
// Token represents a single parsable unit.
Token struct {
- File string
- Line int
- Text string
+ File string
+ Line int
+ Text string
+ inSnippet bool
+ snippetName string
}
)