Tracing parser (#11)
* Add tracing to the parser. * Synthesize a --help flag. * Parsing now occurs in multiple phases. 1. Reset target. 2. Parse command-line into a "trace" (no values are written to target). 3. Apply traced, parsed values to the target fields. This is another step in facilitating context-sensitive help and completion. * Detect duplicate flags.
This commit is contained in:
committed by
Gerald Kaszuba
parent
3eb5e285ed
commit
ab5cf7e6ef
@@ -40,6 +40,10 @@ func (t Token) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (t Token) IsEOL() bool {
|
||||
return t.Type == EOLToken
|
||||
}
|
||||
|
||||
func (t Token) IsAny(types ...TokenType) bool {
|
||||
for _, typ := range types {
|
||||
if t.Type == typ {
|
||||
|
||||
Reference in New Issue
Block a user