js_parser/lexer

Types

pub type Character {
  CharHashbang
  CharBacktick
  CharSingleQuote
  CharDoubleQuote
  CharForwardSlash
  CharBackslash
  CharAsterisk
  CharMinus
  CharPlus
  CharDot
  CharEquals
}

Constructors

  • CharHashbang
  • CharBacktick
  • CharSingleQuote
  • CharDoubleQuote
  • CharForwardSlash
  • CharBackslash
  • CharAsterisk
  • CharMinus
  • CharPlus
  • CharDot
  • CharEquals
pub type ParserState {
  ParserState(input: String, offset: Int, tokens: List(Token))
}

Constructors

  • ParserState(input: String, offset: Int, tokens: List(Token))
pub type Token {
  StringLiteral(value: String, closed: Bool)
  NoSubstitutionTemplate(value: String, closed: Bool)
  TemplateHead(value: String)
  TemplateMiddle(value: String)
  TemplateTail(value: String, closed: Bool)
  RegularExpressionLiteral(value: String, closed: Bool)
  SingleLineComment(value: String)
  MultiLineComment(value: String, closed: Bool)
  HashbangComment(value: String)
  IdentifierName(value: String)
  PrivateIdentifier(value: String)
  NumericLiteral(value: String)
  Punctuator(value: String)
  WhiteSpace(value: String)
  LineTerminatorSequence(value: String)
  Invalid
  EOF
  KeywordAwait
  KeywordBreak
  KeywordCase
  KeywordCatch
  KeywordClass
  KeywordConst
  KeywordContinue
  KeywordDebugger
  KeywordDefault
  KeywordDelete
  KeywordDo
  KeywordElse
  KeywordEnum
  KeywordExport
  KeywordExtends
  KeywordFalse
  KeywordFinally
  KeywordFor
  KeywordFunction
  KeywordIf
  KeywordImport
  KeywordIn
  KeywordInstanceof
  KeywordNew
  KeywordNull
  KeywordReturn
  KeywordSuper
  KeywordSwitch
  KeywordThis
  KeywordThrow
  KeywordTrue
  KeywordTry
  KeywordTypeof
  KeywordVar
  KeywordVoid
  KeywordWhile
  KeywordWith
  KeywordYield
  CharSemicolon
  CharColon
  CharComma
  CharOpenBracket
  CharCloseBracket
  CharOpenBrace
  CharCloseBrace
  CharOpenParen
  CharCloseParen
  CharWhitespace(value: String)
}

Constructors

  • StringLiteral(value: String, closed: Bool)
  • NoSubstitutionTemplate(value: String, closed: Bool)
  • TemplateHead(value: String)
  • TemplateMiddle(value: String)
  • TemplateTail(value: String, closed: Bool)
  • RegularExpressionLiteral(value: String, closed: Bool)
  • SingleLineComment(value: String)
  • MultiLineComment(value: String, closed: Bool)
  • HashbangComment(value: String)
  • IdentifierName(value: String)
  • PrivateIdentifier(value: String)
  • NumericLiteral(value: String)
  • Punctuator(value: String)
  • WhiteSpace(value: String)
  • LineTerminatorSequence(value: String)
  • Invalid
  • EOF
  • KeywordAwait
  • KeywordBreak
  • KeywordCase
  • KeywordCatch
  • KeywordClass
  • KeywordConst
  • KeywordContinue
  • KeywordDebugger
  • KeywordDefault
  • KeywordDelete
  • KeywordDo
  • KeywordElse
  • KeywordEnum
  • KeywordExport
  • KeywordExtends
  • KeywordFalse
  • KeywordFinally
  • KeywordFor
  • KeywordFunction
  • KeywordIf
  • KeywordImport
  • KeywordIn
  • KeywordInstanceof
  • KeywordNew
  • KeywordNull
  • KeywordReturn
  • KeywordSuper
  • KeywordSwitch
  • KeywordThis
  • KeywordThrow
  • KeywordTrue
  • KeywordTry
  • KeywordTypeof
  • KeywordVar
  • KeywordVoid
  • KeywordWhile
  • KeywordWith
  • KeywordYield
  • CharSemicolon
  • CharColon
  • CharComma
  • CharOpenBracket
  • CharCloseBracket
  • CharOpenBrace
  • CharCloseBrace
  • CharOpenParen
  • CharCloseParen
  • CharWhitespace(value: String)

Functions

pub fn new_parser_state(input: String) -> ParserState
pub fn parse(input: String) -> List(Token)
pub fn parse_tokens(state: ParserState) -> List(Token)
Search Document