Renderingla

lege

Reads input from the active input stream.

Syntax: lege [lineam]

Category

io

Related

Examples

examples/corpus/lege/lege.fab (canonical · keyword)

Reads input from the active input stream.

# lege and regex conversio — I/O read and compiled pattern expressions
#
# fixum _ pattern ← "\d+" ↦ regex   -- compiled regex from textus
# fixum _ line ← lege                  -- stdin line read
#
# GRAMMAR:
#   conversio :← stringLit '↦' 'regex'
#   readExpr :← 'lege'
#
# EXPECTED OUTPUT:
#   Regex pattern diagnostic, then one stdin line (no .expected — interactive).
#
# BACKEND: Rust/Go/roundtrip e2e whitelist — lege not yet lowered for Rust/Go
# (whitelist: lege/lege.fab).

incipit {
    fixum _ pattern ← "(?g)\d+" ↦ regex
    nota pattern

    fixum _ line ← lege
    nota line
}