syntax

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 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.

Documentation

Overview

Package syntax holds LKAL text helpers shared by the root package and schema. schema imports this package; the root package does too. Neither imports the other through these helpers, so the schema dependency stays one-way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBareKey

func IsBareKey(k string) bool

IsBareKey reports whether k can be written as an unquoted key. "true" and "false" are quoted, matching the formatter.

func IsControlChar

func IsControlChar(r rune) bool

IsControlChar reports a byte-or-rune that LKAL rejects in strings, comments, and raw lines. Tab is allowed.

func IsNameChar

func IsNameChar(b byte) bool

IsNameChar reports a character that may continue a bare name.

func IsNameStart

func IsNameStart(b byte) bool

IsNameStart reports an ASCII letter or underscore.

func IsRadixPrefix

func IsRadixPrefix(b byte) bool

IsRadixPrefix reports the first byte of a radix prefix LKAL rejects after 0.

func NormalizeNumber

func NormalizeNumber(s string) string

NormalizeNumber returns the canonical spelling of a base-10 integer or decimal. "-0" becomes "0". A decimal keeps one fractional digit when the fraction is zero, so "1.0" and "1.00" both become "1.0".

func QuoteString

func QuoteString(s string) string

QuoteString returns s as an LKAL quoted string.

func ScanNumber

func ScanNumber(s string) (int, bool, bool)

ScanNumber checks a base-10 integer or decimal, ignoring one leading '-'. It returns the count of significant digits, whether a fraction is present, and ok.

Types

This section is empty.

Jump to

Keyboard shortcuts

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