README

dowdiness/js_engine/token does not have a README file

#
LexForm

pub(all) enum LexForm {
LexNormal
StringLegacyOctalEscape
NumberLegacyOctalInt
NumberNonOctalDecimalInt
} derive(Eq,
Debug
)

impl Show for LexForm

#
Loc

pub(all) struct Loc {
line : Int
col : Int
offset : Int
} derive(Eq,
Debug
)

impl Show for Loc

#
Loc::default

fn Loc::default() -> Loc

#
SourceSpan

pub struct SourceSpan {
start_ : Loc
end_ : Loc
} derive(Eq,
Debug
)

A half-open source range expressed in JavaScript source coordinates.

#
SourceSpan::end

fn SourceSpan::end(self : SourceSpan) -> Loc

#
SourceSpan::start

fn SourceSpan::start(self : SourceSpan) -> Loc

#
Token

pub(all) struct Token {
kind : TokenKind
loc : Loc
raw : String
lex_form : LexForm
end_offset : Int
} derive(Eq,
Debug
)

impl Show for Token

#
Token::Token

fn Token::Token(kind : TokenKind, loc : Loc, raw : String, lex_form? : LexForm, end_offset? : Int) -> Token

end_offset is the exclusive UTF-16 code-unit offset in the original source string at which this token ends. When -1 (the default for call sites that don't track source position, e.g. tests), it is derived as loc.offset + raw.length(), which is correct for all tokens whose raw field is the verbatim source slice. The lexer always supplies an explicit value.

#
Token::eof

fn Token::eof(loc : Loc) -> Token

#
Token::new

fn Token::new(kind : TokenKind, loc : Loc, raw : String, lex_form? : LexForm, end_offset? : Int) -> Token

#
Token::source_span

fn Token::source_span(self : Token, source : String) -> SourceSpan?

Resolve this token's half-open source range. Offsets are UTF-16 code units, columns count Unicode scalar values, and CRLF is treated as one line break. Returns None when the token offsets do not describe a slice of source.

#
TokenKind

pub(all) enum TokenKind {
Number(Double)
String_(String)
True
False
Null
Undefined
Ident(String)
PrivateName(String)
Let
Const
Var
Function
Return
If
Else
While
For
Break
Continue
Typeof
Throw
Try
Catch
Finally
New
This
Switch
Case
Default
Void
Delete
Do
In
Instanceof
Class
Extends
Super
Static
Get
Set
Yield
Import
Export
From
As
Plus
Minus
Star
StarStar
Slash
Percent
Assign
EqEq
EqEqEq
BangEq
BangEqEq
Lt
Gt
LtEq
GtEq
And
Or
QuestionQuestion
QuestionDot
Bang
PlusPlus
MinusMinus
PlusAssign
MinusAssign
StarAssign
StarStarAssign
SlashAssign
PercentAssign
BitAnd
BitOr
BitXor
Tilde
LShift
RShift
URShift
BitAndAssign
BitOrAssign
BitXorAssign
LShiftAssign
RShiftAssign
URShiftAssign
AndAssign
OrAssign
NullishAssign
LParen
RParen
LBrace
RBrace
LBracket
RBracket
Comma
Semicolon
Dot
Colon
Question
NoSubTemplate(String, String?)
TemplateHead(String, String?)
TemplateMiddle(String, String?)
TemplateTail(String, String?)
Arrow
DotDotDot
Regex(String, String)
Of
EOF
} derive(Eq,
Debug
)

impl Show for TokenKind

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io