neon

package module
v0.10.0-beta7 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: BSD-3-Clause Imports: 4 Imported by: ? modules, 0 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.

README

gouef/neon

NEON decoder and encoder for GoLang

GoDoc GitHub stars Go Report Card codecov

Vesions

Stable Version GitHub Release GitHub Release

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(input string, position Position) (string, error)

Parse parses a NEON string into its unescaped representation.

Types

type Encoder

type Encoder struct {
	BLOCK bool
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder() Encoder

type Node

type Node struct {
	// contains filtered or unexported fields
}

type Position

type Position struct {
	Line   int
	Column int
	Offset int
}

func NewPosition

func NewPosition(line, column, offset int) Position

func (Position) String

func (p Position) String() string

type StringNode

type StringNode struct {
	Value string
}

StringNode represents a string node in NEON.

func NewStringNode

func NewStringNode(value string) *StringNode

NewStringNode creates a new StringNode.

func (*StringNode) ToString

func (n *StringNode) ToString() string

ToString converts the string value back to a NEON-compatible string representation.

func (*StringNode) ToValue

func (n *StringNode) ToValue() string

ToValue returns the string value of the node.

type Token

type Token struct {
	Type     any
	Text     string
	Position Position
}

func NewToken

func NewToken(tokenType any, text string, position Position) Token

func (Token) Is

func (t Token) Is(kinds ...any) bool

type TokenType

type TokenType int
const (
	String     TokenType = 1
	Literal    TokenType = 2
	Char       TokenType = 0
	Comment    TokenType = 3
	Newline    TokenType = 4
	Whitespace TokenType = 5
	End        TokenType = -1
)

Jump to

Keyboard shortcuts

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