parse

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedFileType = errors.New("unsupported file type")
	ErrNoInput             = errors.New("no file content found")
	ErrInvalidPath         = errors.New("invalid path provided")
	ErrInvalidSyntax       = errors.New("invalid syntax given")
	ErrDuplicatedMarker    = errors.New("duplicated marker within a single file")
)

Functions

func Parse

func Parse(fileName string, input io.Reader) (*file.File, error)

Parse reads filename and input, and parses data in the file.

The steps are as follows:

  1. Read input data
  2. Scan each line
  3. Look for regex match for marker
  4. Save matched line number and options found
  5. Verify parsed data, and return

If any of the above steps failed, it would return an error. This function does not populate the ContentAfter.

TODO: Consider merging with the private parse method, as this public

function is not adding any value at the moment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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