Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modula-2 lexer #2

Closed
1997tn opened this issue Jan 26, 2023 · 0 comments
Closed

Modula-2 lexer #2

1997tn opened this issue Jan 26, 2023 · 0 comments

Comments

@1997tn
Copy link

1997tn commented Jan 26, 2023

The numerical literals part, you might be read the document wrong.

Numbers are (unsigned) integers or real numbers. Integers are sequences of digits. If the number is followed by the letter B, it is taken as an octal number; if it is followed by the letter H, it is taken as a hexadecimal number; if it is followed by the letter C, it denotes the character with the given (octal) ordinal number (and is of type CHAR).

https://www.modula2.org/reference/vocabulary.php

Taken from your code: local modula_octal = R("07")^1*R("BC")

Please pardon me as I don't understand Lua, but only with either B or C is enough for it to be an octal number, not needed to be both BC. In case it has both B, C and H then it will be a hex number.

Note: please notice on the examples on the document, B and C will never go together unless they are also go with H. I don't understand EBNF, but I think | is or so it's B or C not B and C.

@1997tn 1997tn closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant