opendylan icon indicating copy to clipboard operation
opendylan copied to clipboard

Lexical grammar does not follow DRM

Open pedro-w opened this issue 4 years ago • 0 comments

According to the DRM a name is allowed to start with a number (subject to other conditions) but this is not always the case. For example,

define constant 0xx = 23;

is allowed but

define constant 0yy = 24;

gives

Serious warning - Invalid syntax in constant-definer macro call.

/tmp/parser/parser.dylan:79.1-25: Serious warning - Skipping constant-definer macro call due to previous syntax error.
      ------------------------
      define constant 0yy = 24;
      ------------------------

This seems to depend on the first letter in the proposed name, specifically 'd', 'e', 's', 'x' are allowed, others give an error. (for example 123elephant would be allowed as the first letter is 'e')

Note that names starting with numbers are not recommended and rarely if ever used in Dylan code.

pedro-w avatar May 27 '21 07:05 pedro-w