LexerCtx

halotukozak.alpaca.LexerCtx
See theLexerCtx companion trait
object LexerCtx

Attributes

Companion
trait
Experimental
true
Source
lexer.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LexerCtx.type

Members list

Type members

Classlikes

final case class Default(position: Column = ..., line: Line = ...) extends LexerCtx

The default lexer context, composed of the Column and Line tracking fragments.

The default lexer context, composed of the Column and Line tracking fragments.

This is the most commonly used context and provides useful information for error reporting. The text field is inherited from LexerCtx.

position and line are immutable vals of a subtype of Int: Tracking.materialize finds each fragment's given Tracking and threads a fresh copy of this case class through the lexer rather than mutating a field in place. Read them as plain Ints (ctx.line, ctx.position).

Value parameters

line

the current line number (1-based)

position

the current column position within the line (1-based)

Attributes

Companion
object
Source
lexer.scala
Supertypes
trait Serializable
trait LexerCtx
trait Selectable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Default

Attributes

Companion
class
Source
lexer.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Default.type
final case class Empty() extends LexerCtx

An empty lexer context with no extra state tracking.

An empty lexer context with no extra state tracking.

This is the simplest context that only tracks the remaining text. Use this when you don't need line or position tracking.

Attributes

Source
lexer.scala
Supertypes
trait Serializable
trait LexerCtx
trait Selectable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Givens

Givens

Default error handler for any LexerCtx that throws on the first unrecognised character.

Default error handler for any LexerCtx that throws on the first unrecognised character.

Attributes

Source
lexer.scala