Dynamic prefix + base synchronization for Red / Reddit

Interactive prefix editor for R, L, W families

Type prefix, signed/wave toggles, and the input string all stay in sync. The parser accepts values like 0R#, l#AA, or wr#AA, and updates every field on every keystroke.

Supported syntax

[prefix][type][base]#[payload]
The prefix is written first, then the type letters, then the base, and the payload comes after #.
Examples: L2#OAO, 0R#, wr#AA.
No digits after # is valid
0R# is a valid single number representation. Empty payload after # is allowed and is not a parse error.
Dropdown controls the type prefix
Changing signed/wave updates the type prefix, and changing the input string updates signed/wave and the dropdown instantly.

Type mapping

L / l
Laegna Number
L: ordinary=true, wave=false, signed=false
l: ordinary=true, wave=false, signed=true
W / w
Laegna Wave Number
W: ordinary=false, wave=true, signed=false
w: ordinary=false, wave=true, signed=true
R / r
Range selector
R: unsigned range
r: signed range
WR / wr
Wave range selector
WR: unsigned wave range
wr: signed wave range

Dynamic Builder

Every field updates on every keystroke. Prefix, signed, wave, base, and input stay synchronized.

Validation
Waiting for input…
Parsed Structure
—
Flags summary
Parser output

            

Live examples

How the parser behaves

Bidirectional sync
Changing the dropdown updates the type prefix inside the string. Editing the string updates the dropdown, signed/wave state, and any relevant before-# parts.
Keystroke-level updates
Each entry reacts immediately on every input event, so users can type partial values and still see the interface stay aligned.
Empty payload handling
A trailing # with no digits after it is valid. The parser treats that as an allowed empty payload, not an error.

Manuals: implementing this in Red and Reddit

Red manual
1. Use a reactive parser object with fields for prefix, base, signed?, wave?, and input-string.
2. Bind the dropdown and input field to the same state, then on every keystroke parse the string and rewrite the other controls.
3. Keep the parser tolerant of empty payloads after #.
4. When the prefix changes, regenerate the string using the current base and flags.
5. When the string changes, extract type letters and qualifiers, then update all controls.
Reddit manual
If by “Reddit” you mean a second UI mode or variant, mirror the same architecture: parse input first, then derive controls from it. Let R be represented before the type letters, and base after the type letters. Show empty-after-# as valid, not as an error state. Drive all updates from one source of truth so the dropdown, toggles, and string cannot drift apart.