There has been a little backtracking on the scheme that all error codes (and messages) should be unique. There was starting to be a lot of similar messages except for subtle differences like a “; not semicolon” or “; not comma” at the end. The decision was made that this was unnecessary, since the location in the code could be identified by the token being pointed to (comma, semicolon, or EOL), so there's really no point to having multiple unique errors for these.
It would require too much space to try an explain all the details of the changes, but here is a summary of the major changes:
- Print-only functions are checked if invalid immediately upon receipt instead of waiting until the function is processed at the closing parentheses (without this, a statement like A=TAB(B$) would report that the argument is invalid possible implying that the TAB is okay in the assignment).
- The counter stack was modified to hold both the operand counter it previously held and a new number of expected arguments value that is set for internal functions. This value is used to determine if another argument is expected or no more arguments are expected for a given internal function.
- The comma and semicolon token handlers were reorganized for better error reporting.
- The expression end check function was modified to check if a comma or closing parentheses is expected for internal functions (complicated by functions having different number of arguments).
- Many checks of the current mode were required in the different locations in the Translator code so the correct error could be reported.
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)