MCPcopy
hub / github.com/caddyserver/caddy / NextArg

Method NextArg

caddyconfig/caddyfile/dispenser.go:89–99  ·  caddyconfig/caddyfile/dispenser.go::Dispenser.NextArg

NextArg loads the next token if it is on the same line and if it is not a block opening (open curly brace). Returns true if an argument token was loaded; false otherwise. If false, all tokens on the line have been consumed except for potentially a block opening. It handles imported tokens correctly.

()

Source from the content-addressed store, hash-verified

87// a block opening. It handles imported tokens
88// correctly.
89func (d *Dispenser) NextArg() bool {
90 if !d.nextOnSameLine() {
91 return false
92 }
93 if d.Val() == "{" {
94 // roll back; a block opening is not an argument
95 d.cursor--
96 return false
97 }
98 return true
99}
100
101// nextOnSameLine advances the cursor if the next
102// token is on the same line of the same file.

Callers 15

ArgsMethod · 0.95
AllArgsMethod · 0.95
CountRemainingArgsMethod · 0.95
RemainingArgsMethod · 0.95
RemainingArgsRawMethod · 0.95
RemainingArgsAsTokensMethod · 0.95
NextSegmentMethod · 0.95
parseACMEServerFunction · 0.80
UnmarshalCaddyfileMethod · 0.80
UnmarshalCaddyfileMethod · 0.80
UnmarshalCaddyfileMethod · 0.80
unmarshalCaddyfileMethod · 0.80

Calls 2

nextOnSameLineMethod · 0.95
ValMethod · 0.95

Tested by 2

UnmarshalCaddyfileMethod · 0.64
TestDispenser_NextArgFunction · 0.64