The obvious answer is to support a structured editor that stores the editor, namely the text AST. This allows the editor to suggest how to continue editing when only partial input is provided (for example, after the word “while”, the editor knows that “(” is necessary and can suggest, he can insert the full “if” operator after providing only the keyword, he may complain that the syntax entered is incorrect during input, etc.)
Many such editors were built, most of them were not successful; people seem to love / hate editors who do this.
, , Harmonia . : GLR.