Skip to content

Syntax highlighting categories #21

@hackerb9

Description

@hackerb9

What are the conventions for syntax highlighting of BASIC code? While working on issue #20 (derived modes), I have run into a problem that I do not know the meaning of groupings like basic-builtin-regexp and basic-keyword-regexp.

If there is a "typical" convention, it would be helpful to have it in the comments in basic-mode.el. If there is not, and I suspect there isn't yet, it may be good to see what others have done and look at what makes sense.


Note that not all of the categories are confusing. Comments, constants, strings, and so on are self-explanatory. The ones that I'd like to get nailed down are:

  • functions: this one seems to be for the keywords (like SIN()) which return a value. The definition of it makes sense, but there is some question about whether things like PEEK() and TIME$ belong. And is this distinction even helpful to a programmer?
  • keywords: currently appears to be the bones which lay the structure of a BASIC program. Includes control-flow and function/subroutine definitions. There are few confusing entries, though, like AS and RANDOMIZE. And wouldn't it make more sense for data type declarations like DEFINT to be highlighted as a type?
  • builtins: appears to be the meat: all the other statements which do something. PRINT, PEEK, POKE, etc. But there are several counter examples to that idea. DATA and LET seem to be more structural. AND, MOD, NOT, OR, and XOR are operators and I would have expected them to be highlighted differently.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions