Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/windmill/node_modules/yaml/dist/parse/lexer.d.ts>Lexer

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
class Lexer
import { Lexer } from "https://deno.land/x/windmill@v1.303.4/node_modules/yaml/dist/parse/lexer.d.ts";

Splits an input string into lexical tokens, i.e. smaller strings that are easily identifiable by tokens.tokenType().

Lexing starts always in a "stream" context. Incomplete input may be buffered until a complete token can be emitted.

In addition to slices of the original input, the following control characters may also be emitted:

  • \x02 (Start of Text): A document starts with the next token
  • \x18 (Cancel): Unexpected end of flow-mode (indicates an error)
  • \x1f (Unit Separator): Next token is a scalar value
  • \u{FEFF} (Byte order mark): Emitted separately outside documents

Properties

private
atEnd

Flag indicating whether the end of the current buffer marks the end of all input

private
atLineEnd
private
blockScalarIndent

Explicit indent set in block scalar header, as an offset from the current minimum indent, so e.g. set to 1 from a header |2+. Set to -1 if not explicitly set.

private
blockScalarKeep

Block scalars that include a + (keep) chomping indicator in their header include trailing empty lines, which are otherwise excluded from the scalar's contents.

private
buffer

Current input

private
charAt
private
continueScalar
private
flowKey

Flag noting whether the map value indicator : can immediately follow this node within a flow context.

private
flowLevel

Count of surrounding flow collection levels.

private
getLine
private
hasChars
private
indentNext

Minimum level of indentation required for next lines to be parsed as a part of the current scalar value.

private
indentValue

Indentation level of the current line.

private
lineEndPos

Position of the next \n character.

private
next

Stores the state of the lexer if reaching the end of incpomplete input

private
parseBlockScalar
private
parseBlockScalarHeader
private
parseBlockStart
private
parseDocument
private
parseFlowCollection
private
parseLineStart
private
parseNext
private
parsePlainScalar
private
parseQuotedScalar
private
parseStream
private
peek
private
pos

A pointer to buffer; the current position of the lexer.

private
pushCount
private
pushIndicators
private
pushNewline
private
pushSpaces
private
pushTag
private
pushToIndex
private
pushUntil
private
setNext

Methods

lex(source: string, incomplete?: boolean): Generator<string, void, unknown>

Generate YAML tokens from the source string. If incomplete, a part of the last line may be left as a buffer for the next call.