Empty

halotukozak.alpaca.LexerCtx.Empty
final case class Empty() extends LexerCtx

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
Graph
Supertypes
trait Serializable
trait LexerCtx
trait Selectable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def applyDynamic(name: String)(args: Any*): Any

Structural fallback for the getter/setter refinement that ctx (see below) types itself with, so that ctx.field += 1 type-checks even when field is an immutable val. The lexer macro rewrites away every such structural access inside a rule before it is compiled, so in practice this is only a safety net; it should never be hit at runtime.

Structural fallback for the getter/setter refinement that ctx (see below) types itself with, so that ctx.field += 1 type-checks even when field is an immutable val. The lexer macro rewrites away every such structural access inside a rule before it is compiled, so in practice this is only a safety net; it should never be hit at runtime.

Attributes

Inherited from:
LexerCtx
Source
lexer.scala
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala
final def remainingText: CharSequence

A read-only view of the text still remaining to be tokenized.

A read-only view of the text still remaining to be tokenized.

Exposed so a custom alpaca.internal.lexer.ErrorHandling instance can inspect the character(s) that failed to match any token rule, e.g. to build a diagnostic message such as unexpected '${ctx.remainingText.charAt(0)}'.

Attributes

Inherited from:
LexerCtx
Source
lexer.scala

Inherited fields

var lastRawMatched: String

The raw string that was matched for the last token.

The raw string that was matched for the last token.

Attributes

Note

Internal API — the lexer macro reads this field at user-site, so it has to be source-visible outside the alpaca package.

Inherited from:
LexerCtx
Source
lexer.scala