(Originally posted by EelcoVisser)

Entire file cannot be parsed


module templates

rules // template definitions

declare-template :
TemplateDef(mod*, x, params, elems) -> TemplateDef(mod*, x, params, elems)
with ?def; rules( Template : x -> def )

is-page-def =
?TemplateDef([Page()],,,_)

param-types :
TemplateDef(mod*, x, params, elems) -> <map(?Param(_,))> params

rename :
TemplateDef(mod*, x, param1*, elem1*) -> TemplateDef(mod*, x, param2*, elem2*)
with {| RenameId
: param2* := param1*
; elem2* := elem1*
|}

rename :
Param(x, t) -> Param(y, t)
with y := (x, t)

rules // template variables

rename :
VarDeclElem(x, t, e1) -> VarDeclElem(y, t, e2)
with e2 := e1;
y := (x, t)

check :
VarDeclElem(x, t, e) -> (e, [“Expression should have type ’”, t, “’”])
where not( e => t)

rules // template element iteration

rename :
ForElem(x, t, e1, elem1*) -> ForElem(y, t, e2, elem2*)
with e2 := e1;
{| RenameId
: y := (x, t)
; elem2* := elem1*
|}

check :
ForElem(x, t, e, elem*) -> (e, [“Should have type ’”, SetType(t), “’”])
where not( e => SetType(t))

rules // navigation

template-of :
Navigate(x, args, elems) -> x

check :
Navigate(x, args, elems) -> (x, [“Navigation to non-existing page”])
where not(template-of)

check :
Navigate(x, args, elems) -> (x, [“Navigation to (non-page) template definition”])
where not(template-of; is-page-def)

check :
Navigate(x, e*, elems) ->
where t* := <template-of; param-types>; errors := <zip(check-arg)> (e*, t*)

check-arg :
(e, t) -> (e, [“Type of argument should be ’”, t, “’”]
where not( e => t)

Submitted by Jira on 16 February 2010 at 16:06

On 16 February 2010 at 16:06 Jira commented:

(Originally posted by EelcoVisser)

Problem is the missing rhs of this rule:

check :
Navigate(x, e*, elems) ->
where t* := <template-of; param-types>; errors := <zip(check-arg)> (e*, t*)

In combination with the missing ) in the rhs of this rule:

check-arg :
(e, t) -> (e, [“Type of argument should be ’”, t, “’”]
where not( e => t)


On 23 September 2011 at 18:57 Maartje commented:

Probably an EOF related bug in region recovery.

Adding a newline at the end of the file gives a better recovery (parent region). At least, the file is parsed then.


On 17 October 2012 at 11:27 Maartje closed this issue.

On 17 October 2012 at 11:27 Maartje commented:

old issue.

Log in to post comments