Kết xuấtvi

đọc

Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.

Reads input from the active input stream.

Syntax: đọc [dòng]

Category#

io

Examples#

radix/corpus/lege/lege.fab (canonical · keyword)#

Reads input from the active input stream.

# =============================================================================
# đọc — Reads input from the active input stream.
# =============================================================================
#
# What this teaches:
#   • stdin input with `đọc` — reads one line from the active input stream
#   • the `↦ chính_quy` chuyển — compiling a văn_bản pattern into a chính_quy value
#
# Common mistakes:
#   • Not checking is null before using the value — read may return null at end of input.
#
# See also: dòng, viết
# =============================================================================

# đọc and chính_quy chuyển_đổi — I/O read and compiled pattern expressions
#
# hằng _ pattern ← "\d+" ↦ chính_quy   -- compiled chính_quy from văn_bản
# hằng _ input ← đọc                  -- stdin line read
#
# GRAMMAR:
#   chuyển_đổi :← stringLit '↦' 'chính_quy'
#   readExpr :← 'đọc'
#
# EXPECTED OUTPUT:
#   Regex pattern diagnostic, then one stdin line (no .expected — interactive).
#
# BACKEND: Rust/Go/roundtrip e2e whitelist — đọc not yet lowered for Rust/Go
# (whitelist: đọc/lege.fab).

main {
    const chính_quy pattern ← "(?i)\d+" ↦ chính_quy
    print pattern
    const string ∪ none input ← read
    print input
}