lexer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unescape

func Unescape(body string) string

Unescape decodes the escape sequences in a string-literal body (the text between the quotes) exactly as readString does. It is the inverse view of Token.Raw: the parser splits an interpolated string on the raw text, then decodes each literal segment through here.

Types

type Lexer

type Lexer struct {

	// ModeDirective captures a Luau-style type-mode pragma found in a
	// leading comment of the file: "strict", "nonstrict", or "nocheck".
	// Empty string means none was set. First directive wins. Recognised
	// only in comments that appear before any non-comment token has been
	// produced (matches Luau's "file head" rule).
	ModeDirective string
	// contains filtered or unexported fields
}

func New

func New(input string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() token.Token

Jump to

Keyboard shortcuts

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