caffeine_lang/frontend/token

Types

A token with source position information.

pub type PositionedToken {
  PositionedToken(token: Token, line: Int, column: Int)
}

Constructors

  • PositionedToken(token: Token, line: Int, column: Int)

A token produced by the tokenizer.

pub type Token {
  KeywordSuccessRate
  KeywordTimeSlice
  KeywordAssumes
  KeywordGuarantees
  KeywordOver
  KeywordWindow
  KeywordAs
  KeywordMeasured
  KeywordBy
  KeywordWith
  KeywordBelow
  KeywordHard
  KeywordSoft
  KeywordDependency
  KeywordOn
  KeywordExtends
  KeywordRequires
  KeywordProvides
  KeywordIn
  KeywordX
  KeywordString
  KeywordInteger
  KeywordFloat
  KeywordBoolean
  KeywordList
  KeywordDict
  KeywordOptional
  KeywordDefaulted
  KeywordType
  KeywordURL
  KeywordPercentage
  LiteralString(String)
  LiteralInteger(Int)
  LiteralFloat(Float)
  LiteralPercentage(Float)
  LiteralDuration(amount: Float, unit: String)
  LiteralTrue
  LiteralFalse
  SymbolLeftBrace
  SymbolRightBrace
  SymbolLeftParen
  SymbolRightParen
  SymbolLeftBracket
  SymbolRightBracket
  SymbolColon
  SymbolComma
  SymbolStar
  SymbolPipe
  SymbolEquals
  SymbolDotDot
  WhitespaceNewline
  WhitespaceIndent(Int)
  CommentLine(String)
  CommentSection(String)
  CommentDoc(String)
  Identifier(String)
  EOF
}

Constructors

  • KeywordSuccessRate
  • KeywordTimeSlice
  • KeywordAssumes
  • KeywordGuarantees
  • KeywordOver
  • KeywordWindow
  • KeywordAs
  • KeywordMeasured
  • KeywordBy
  • KeywordWith
  • KeywordBelow
  • KeywordHard
  • KeywordSoft
  • KeywordDependency
  • KeywordOn
  • KeywordExtends
  • KeywordRequires
  • KeywordProvides
  • KeywordIn
  • KeywordX
  • KeywordString
  • KeywordInteger
  • KeywordFloat
  • KeywordBoolean
  • KeywordList
  • KeywordDict
  • KeywordOptional
  • KeywordDefaulted
  • KeywordType
  • KeywordURL
  • KeywordPercentage
  • LiteralString(String)
  • LiteralInteger(Int)
  • LiteralFloat(Float)
  • LiteralPercentage(Float)
  • LiteralDuration(amount: Float, unit: String)

    A duration literal like 10d, 50ms, 0.200s. unit is the raw suffix as written (one of “ms”, “s”, “m”, “h”, “d”); kept as a string so the formatter can round-trip the source.

  • LiteralTrue
  • LiteralFalse
  • SymbolLeftBrace
  • SymbolRightBrace
  • SymbolLeftParen
  • SymbolRightParen
  • SymbolLeftBracket
  • SymbolRightBracket
  • SymbolColon
  • SymbolComma
  • SymbolStar
  • SymbolPipe
  • SymbolEquals
  • SymbolDotDot
  • WhitespaceNewline
  • WhitespaceIndent(Int)
  • CommentLine(String)
  • CommentSection(String)
  • CommentDoc(String)
  • Identifier(String)
  • EOF
Search Document