Tracking

halotukozak.alpaca.internal.lexer.Tracking
See theTracking companion object
trait Tracking[F]

A per-token update for a single lexer-context field (a "fragment" such as Line or Column).

Tracking.materialize applies one Tracking instance to each case field of the context whose type provides a given, threading the result through a functional copy; fields whose type has no Tracking given are left untouched by the hook (they only change in rule bodies).

This is how tracking composes without inheritance: define a distinct field type and a given Tracking[YourType] in its companion, then use it as a context field.

Type parameters

F

the fragment field type

Attributes

Companion
object
Experimental
true
Source
Tracking.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def apply(matched: String, field: F): F

Value parameters

field

the fragment's current value

matched

the raw text of the token just matched

Attributes

Returns

the fragment's new value

Source
Tracking.scala