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

Open
autoboosh opened this Issue Jun 4, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@autoboosh
Copy link
Contributor

autoboosh 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:

// 5.3.1.5 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 :
    positionalParam
    | 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.

@Vogel612

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.