You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a few more semantically erroneous programs that are grammatically correct. Follows the structure and naming of other examples (semantic_error_<i>.pcl)
Coverage
Labels:
Illegal cross scope goto
goto to a declared but undefined label
Functions & Procedures:
Usage of result keyword in non-function blocks
Inconsistency between forward and actual header declarations
Assignment from a procedure call
Passing a constant or expression to a var argument (l-value expected)
This I'm not so sure about since some lexical erroneous programs (e.g.) do use it, but are just marked as lexical errors.
It's not formally defined in the pdf, but I think what makes sense is that it should only exist in functions' main blocks. So, If you want, I can change/fix the lexical erroneous examples to not have this semantic error
This I'm not so sure about since some lexical erroneous programs (e.g.) do use it, but are just marked as lexical errors.
It's a bit unclear what you are concerned about. The program you mention is lexically erroneous because it contains a stray $ character, so it should be rejected early by the lexer, and never reach the semantic analysis pass of a (correct) PCL compiler. So, whether the result keyword is used correctly or not in that program is irrelevant (a non-issue).
If I have misunderstood your concern, feel free to comment again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a few more semantically erroneous programs that are grammatically correct. Follows the structure and naming of other examples (
semantic_error_<i>.pcl)Coverage
Labels:
gotogototo a declared but undefined labelFunctions & Procedures:
resultkeyword in non-function blocksforwardand actual header declarationsvarargument (l-value expected)Misc:
nil