parser

package
v0.9.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: GPL-3.0 Imports: 9 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config provides set of utilities for configuration parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeErr

func NodeErr(node Node, f string, args ...interface{}) error

Types

type Node

type Node struct {
	// Name is the first string at node's line.
	Name string
	// Args are any strings placed after the node name.
	Args []string

	// Children slice contains all children blocks if node is a block. Can be nil.
	Children []Node

	// Snippet indicates whether current parsed node is a snippet. Always false
	// for all nodes returned from Read because snippets are expanded before it
	// returns.
	Snippet bool

	// Macro indicates whether current parsed node is a macro. Always false
	// for all nodes returned from Read because macros are expanded before it
	// returns.
	Macro bool

	// File is the name of node's source file.
	File string

	// Line is the line number where the directive is located in the source file. For
	// blocks this is the line where "block header" (name + args) resides.
	Line int
}

Node struct describes a parsed configurtion block or a simple directive.

name arg0 arg1 {
 children0
 children1
}

func Read

func Read(r io.Reader, location string) (nodes []Node, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL