Closed
Description
Describe the bug
Cppfront allows a semicolon at the end of each parameter, before the comma.
To Reproduce
Steps to reproduce the behavior:
- Sample code
Found from https://github.com/isidorostsa/RayTrayCpp2/blob/main/src/inc/camera.h2#L32, but much simpler:
func: (a: double;, b: uint;, c: double;) = {}
- Command lines including which C++ compiler you are using
- Expected result - what you expected to happen
Error for having a semicolon in the parameter list.
- Actual result/error
Success.
Additional context
I tried digging into the grammar to see where this semicolon is being allowed, but I couldn't find it.
Matching `(a: double;, b: uint;, c: double;)`
//G parameter-declaration-list:
//G '(' parameter-declaration-seq? ','? ')'
'(' <a: double;, b: uint;, c: double;> <> ')'
//G parameter-declaration-seq:
//G parameter-declaration
<a: double;>
<b: uint;>
<c: double;>
//G parameter-declaration-seq ',' parameter-declaration
<a: double;, b: uint;> ',' <c: double;>
<a: double;> ',' <b: uint;>
//G parameter-declaration:
//G this-specifier? parameter-direction? declaration
<> <> <a: double;>
<> <> <b: uint;>
<> <> <c: double;>
//G declaration:
//G access-specifier? identifier '...'? unnamed-declaration
<> <a> <> <: double;>
<> <b> <> <: uint;>
<> <c> <> <: double;>
//G access-specifier? identifier alias
No '==' for alias, so these won't match.
//G unnamed-declaration:
//G ':' meta-functions? template-parameters? function-type requires-clause? '=' statement
No '=', doesn't match.
//G ':' meta-functions? template-parameters? function-type statement
No '(' for function-type, doesn't match.
//G ':' meta-functions? template-parameters? type-id? requires-clause? '=' statement
No '=', doesn't match.
//G ':' meta-functions? template-parameters? type-id
':' <> <> <double;>
':' <> <> <uint;>
//G ':' meta-functions? template-parameters? 'final'? 'type' requires-clause? '=' statement
No '=', doesn't match.
//G ':' 'namespace' '=' statement
No '=', doesn't match.
//G type-id:
//G type-qualifier-seq? qualified-id
No '::' for qualified-id, doesn't match.
//G type-qualifier-seq? unqualified-id
<> <double;>
<> <uint;>
//G unqualified-id:
//G identifier
Shouldn't include ';'.
//G keyword
Not a keyword.
//G template-id
No '<' for template-id, doesn't match.
//GTODO operator-function-id
//G ...
Is this an actual grammar thing that might be picking up `double;` and `uint;`?