gracelang / language

Design of the Grace language and its libraries
GNU General Public License v2.0
6 stars 1 forks source link

Corrections to the Grammar #105

Closed apblack closed 6 years ago

apblack commented 8 years ago

How do we make corrections to the grammar that's in the spec?

Presumably, we should be correcting the source code and the tests, and then re-generating it. But all of the parts are not in the repo.

I was looking at the grammar for blocks. It reads:

blockLiteral ::= lBrace ~ opt(ws) ~ opt(genericParams ~ opt(matchBinding) ~ blockParams ~ opt(ws)~ arrow) ~ innerCodeSequence ~ rBrace genericParams ::= opt(lGeneric ~ rep1sep(identifier, comma) ~ rGeneric) blockParams ::= repsep( identifier ~ opt(colon ~ typeExpression), comma)

Apart from using the name genericParams in place of typeParameters, this doesn't look right. It says that if a block has typeParameters, then it must have blockParams.

I think that a matchBinding is just a special case of a blockParam, and should not be an alternative production.

{ "a" -> ... }  \\ is a shorthand for
{_:"a" -> ... }
kjx commented 8 years ago

How do we make corrections to the grammar that's in the spec? Presumably, we should be correcting the source code and the tests, and then re-generating it.

sure. hopefully coordinating with me, (although perhaps github will do this for me)

But all of the parts are not in the repo.

I've just pushed and pulled, then do ". runtest.sh" and "runall" and all the tests run on the latest Kernan.

kjx commented 6 years ago

We agreed to replace it with the Smallgrace grammar - see #131