रेंडरिंगhi

ascii

Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.

Single-quoted ASCII machine-text literals.

Aliases: '...'

Syntax: '<text>'

Category#

literal

Examples#

radix/corpus/literalia/ascii.fab (canonical · existing-home)#

Single-quoted ASCII machine-text literals.

# =============================================================================
# ascii — Single-quoted ASCII machine-text literals.
# =============================================================================
#
# What this teaches:
#   • single-quoted ASCII literals `'...'` — compact syntax for machine-facing strings like route paths
#
# Common mistakes:
#   • Including non-ASCII characters in ascii literals — ascii literals are ASCII-only; use "..." for Unicode पाठ.
#
# See also: पाठ, string
# =============================================================================

# literalia/ascii — '...' literals
#
# EXPECTED OUTPUT:
#   pg:query

main {
    const ascii route ← 'pg:query'
    print route
}

Expected output:

pg:query

radix/corpus/bounded/conversio-ascii-overflow-decline.fab (supporting · reject)#

Decline: an ascii literal longer than the target capacity rejects with ascii_literal_too_long.

# =============================================================================
# ascii overflow decline — literal over capacity fails closed
# =============================================================================
#
# Decline row (reject reason in the comment):
#   1. over capacity — `'alpha' ↦ ascii<4>` asks a 5-byte literal to fit a
#      capacity of 4: SEM011 ascii_literal_too_long
#
# Common mistakes:
#   • expecting silent truncation — the D7 overflow rule fails closed at
#     check for literals whose byte count exceeds the target capacity
#
# See also: ↦, ascii
# =============================================================================

# ascii literal over capacity — expected compile failure
#
# WHY: pins the fail-closed overflow token in conversio-ascii-overflow-decline.expected.

main {
    const ascii<4> a ← 'alpha' ↦ ascii<4>
    print a
}

Expected: compilation rejects this example.