diff options
author | WeidiDeng <weidi_deng@icloud.com> | 2023-05-26 03:05:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-25 13:05:00 -0600 |
commit | 9cde71552576dcc724eff38dee42879c927b72ec (patch) | |
tree | 5af6bec905fadbc7ef0f9d8be610f7ffe3758682 /caddyconfig/caddyfile/lexer.go | |
parent | 942fbb37ec46f1907e57a04c44ca790bd47ed52c (diff) |
caddyfile: Track import name instead of modifying filename (#5540)
* Merge branch 'master' into import_file_stack
* remove space in log key
Diffstat (limited to 'caddyconfig/caddyfile/lexer.go')
-rw-r--r-- | caddyconfig/caddyfile/lexer.go | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/caddyconfig/caddyfile/lexer.go b/caddyconfig/caddyfile/lexer.go index 1f531f4..d1fbfbb 100644 --- a/caddyconfig/caddyfile/lexer.go +++ b/caddyconfig/caddyfile/lexer.go @@ -39,7 +39,7 @@ type ( // Token represents a single parsable unit. Token struct { File string - origFile string + imports []string Line int Text string wasQuoted rune // enclosing quote character, if any @@ -321,23 +321,6 @@ func (l *lexer) finalizeHeredoc(val []rune, marker string) ([]rune, error) { return []rune(out), nil } -// originalFile gets original filename before import modification. -func (t Token) originalFile() string { - if t.origFile != "" { - return t.origFile - } - return t.File -} - -// updateFile updates the token's source filename for error display -// and remembers the original filename. Used during "import" processing. -func (t *Token) updateFile(file string) { - if t.origFile == "" { - t.origFile = t.File - } - t.File = file -} - func (t Token) Quoted() bool { return t.wasQuoted > 0 } |