One grammar.
مفردات بلغتين.
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.
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.
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.
عدد_الطلاب · student_count · errno
One file may contain Arabic and Latin identifiers. Each identifier uses one strong script.
student_عدد
A single mixed-script identifier fails. Arabic-Indic digits, ZWJ, ZWNJ, and default-ignorables also fail.
name: type = value;
Four spaces, no tabs or space-alignment, braces on the header line, and one statement per line.