Skip to content

tomefile/lib-validator

Repository files navigation

Tomefile Validator library

Library to validate Tomefile Parser output

Example Usage

Using it directly

node, derr := libvalidator.Validate(...)
if derr != nil {
    derr.Print(os.Stderr)
    os.Exit(1)
}

Using parser's post-processing (recommended)

// This has the benefit of having fields expanded:
// - libparser.ExecNode{}.Binary -> changes to full file path to binary
// - libparser.StringNode{}.Segments -> stores format segments

parser := libparser.New(file).With(libparser.Validate)

tree, derr := parser.Parse()
if derr != nil {
    derr.Print(os.Stderr)
    os.Exit(1)
}

About

Library to validate Tomefile Parser output

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages