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
Parse bounds expression in function parameter list scope.
This change addresses issue checkedc#7 (process bounds expressions for parameters
with all the parameters available). Currently, bounds expressions for
parameters are being parsed and type checked in the scope of the parameters
seen so far in a parameter list. They need to be typechecked in a scope with
all the parameters for the parameter list.
To do this, parsing and type checking of bounds expressios for parameters
is deferred until the entire parameter list has been seen. This is done
in two steps. During the initial parse, the tokens for a superset of bounds
expressions are parsed and stored in a list. They are then re-parsed using
ParseBoundsExpressions after all parameters have been seen.
This change also improve serror messages when a bounds expression is parsed
with misspelled contextual keyword. For example, int x : boounds(x, x + 5).
Before, the code would simply give up after parsing the misspelled keyword
and the '('. This led to additional error messages when the code tried to
match the closing ')'. This fix is to skip all the tokens up to but not
including the closing ')'.
Testing:
* Passes existing clang test suite.
* Added additional tests for parsing of function parameter lists with bounds
expressions. This will be commited separtely to the checked repo.
0 commit comments