apoch / epoch-language

Home of the Epoch Programming Language Project
Other
72 stars 3 forks source link

Parser fails on trailing functions with no code body #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following program causes a weird parser crash:

//
// FUNCTIONS.EPOCH
//
// Compiler test for higher-order functions
//

entrypoint :
{
    apply("test", debugwritestring)
    debugwritestring(apply("test", mutate))
}

apply : string param, (thefunction : string)
{
    thefunction(param)
}

apply : string param, (thefunction : string -> string) -> string(ret, 
thefunction(param))

mutate : string param -> string(ret, param ; " foo")

The trailing "mutate" function has no code body, which causes a parse failure 
when trying to match the code block sub-grammar. This should be fixable with 
some contortions.

Original issue reported on code.google.com by don.ap...@gmail.com on 18 Feb 2012 at 1:30

GoogleCodeExporter commented 9 years ago
Fixed in revision 225.

Original comment by don.ap...@gmail.com on 20 Feb 2012 at 12:05

GoogleCodeExporter commented 9 years ago
Or revision abd630d8da3a if you want the actual diff.

Original comment by don.ap...@gmail.com on 20 Feb 2012 at 12:07