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

Grammar: argList should be parameter list #1698

ghost opened this issue Jun 4, 2016 · 1 comment

Grammar: argList should be parameter list #1698

ghost opened this issue Jun 4, 2016 · 1 comment


Copy link

@ghost ghost commented Jun 4, 2016

The current grammar has an argumentList and an argList rule. The argList rule should actually be called parameter list. Here's a possible new grammar rule:

// Parameter Lists 
procedureParameters : LPAREN whiteSpace? parameterList? whiteSpace? RPAREN;
propertyParameters : LPAREN whiteSpace? (parameterList whiteSpace? COMMA whiteSpace?)? valueParam whiteSpace? RPAREN;  
parameterList : parameter (whiteSpace? COMMA whiteSpace? parameter)*;
parameter :
    | optionalParam
    | paramArray
valueParam : positionalParam;
positionalParam : (parameterMechanism whiteSpace)? parameterDeclaration; 
optionalParam : optionalPrefix whiteSpace parameterDeclaration (whiteSpace? defaultValue)?;
paramArray : PARAMARRAY whiteSpace paramArrayName whiteSpace? LPAREN whiteSpace? RPAREN (whiteSpace AS whiteSpace builtInType)?;
paramArrayName : untypedIdentifier;
parameterDeclaration : untypedNameParameterDeclaration | typedNamedParameterDeclaration;
untypedNameParameterDeclaration : untypedNameParameterName (whiteSpace? parameterType)?;
untypedNameParameterName : untypedIdentifier;
typedNamedParameterDeclaration : typedIdentifier (whiteSpace? arrayDesignator)?;
optionalPrefix :
    OPTIONAL (whiteSpace parameterMechanism)?
    | (parameterMechanism whiteSpace)? OPTIONAL
parameterMechanism : BYVAL | BYREF; 
parameterType : (arrayDesignator whiteSpace)? AS whiteSpace expression;
defaultValue : EQ whiteSpace? expression;

Edit: Simplified parameter list so that the codebase has one simple list of parameters to work with.

Copy link

@Vogel612 Vogel612 commented Dec 7, 2017

@MDoerner @ThunderFrame opinions on this? Is this a good change? Otherwise we should close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants