One grammar.
مفردات بلغتين.

This lab tests one Arabic-first language with exact English keyword aliases. It is evidence for the specification, not playground UI.

Throwaway notation prototype
One token set Each Arabic and English pair becomes the same parser token before grammar rules run.
Identifiers keep their spelling Names are never translated. One name uses Arabic or Latin script, while one file may use both.
ASCII carries structure Braces, operators, Western digits, commas, colons, arrows, and semicolons have one spelling.
Display does not change source Editors may order token atoms RTL or LTR. The compiler always parses stored logical order.

Read the same program from either vocabulary

The panes share structure and semantics. Arabic and English keywords differ, as does the reserved entry spelling. Identifiers are ordinary names and can stay Arabic in both panes.

المفردات العربية RTL atom order · Swipe horizontally
English vocabulary LTR atom order · Swipe horizontally

Proposed keyword ledger

Both columns are reserved everywhere. A file has no language mode, so copied examples and foreign API names do not create a separate dialect.

One grammar after alias lookup

The grammar names normalized tokens, not source spellings. Function results and parameters require types. Local declarations infer a type unless they include an annotation.

program      = { function | foreign-declaration } ;
function     = FN name "(" [ parameters ] ")" "->" type block ;
binding      = ( LET | VAR ) name [ ":" type ] "=" expression ";" ;
conditional  = IF expression block [ ELSE block ] ;
loop         = WHILE expression block ;
return       = RETURN [ expression ] ";" ;
block        = "{" { statement } "}" ;

// Arabic and English spellings map to the capitalized tokens.
// Every operator and punctuation mark above is ASCII.

Mix vocabulary without changing the program

Click any gold keyword to flip only that occurrence. The normalized stream stays fixed. This is the proposed mixed-vocabulary contract in executable form.

Swipe source horizontally to inspect its logical end.
Accepted anywhere Arabic and English aliases can mix within one function or statement without a compiler warning.
Never translated Identifiers, strings, comments, C symbols, and file paths retain the exact spelling the author wrote.
Formatting preserves Default formatting keeps each keyword spelling. An explicit vocabulary conversion can rewrite aliases later.
Documentation leads in Arabic Canonical examples use Arabic vocabulary. English documentation renders equivalent fixtures from the same tests.

Separate raw editing from safe token display

Edit the stored text on the left and switch its base direction. The right side re-renders lexical atoms without changing their logical sequence. This makes the bidi contract visible instead of trusting a plain RTL textarea.

Token-aware display
Each token is an isolated display atom. Numeric atoms always render LTR, comment content chooses its own direction, and every other atom follows the selected order. Swipe horizontally to inspect the logical end.
Compiler rule
Only LRM and RLM may appear invisibly at legal token boundaries. The safe view prints every control by code point and name. A control inside an identifier is an error.
    Legal names together عدد_الطلاب · student_count · errno One file may contain Arabic and Latin identifiers. Each identifier uses one strong script.
    Rejected name student_عدد A single mixed-script identifier fails. Arabic-Indic digits, ZWJ, ZWNJ, and default-ignorables also fail.
    Stable formatting name: type = value; Four spaces, no tabs or space-alignment, braces on the header line, and one statement per line.