INCLAN: Commands

From CYANA Wiki
Jump to navigation Jump to search

When reading an input command line the command interpreter executes the following steps:

  1. An optional comment, i.e. text following a comment sign “#”, is discarded.
  2. The values of variables are substituted from right to left.
  3. The command line is split into elements, defined as sequences of non-blank characters separated by blank characters. The first element becomes the command name. The following elements become command parameters.
  4. If the command name matches a user-defined alias, the alias is expanded.
  5. If the command name matches a built-in command of INCLAN, it is executed by the command interpreter itself.
  6. Otherwise, if the command name matches a user-defined command (see INCLAN command command below), it is executed by the command interpreter.
  7. Otherwise, if the command name matches a command of the underlying program unambiguously, it is executed by the program.
  8. Otherwise, the command interpreter looks for a macro with the given command name and, if it is found in the current macro search path, executes it. If no such macro is found, an error occurs.