This is my initializer in the .pegcoffee file
{
@knownNamespaces = []
@isKnownNamespace = (ns) ->
for x in namespaces
if ns in x
return true
return false
}
When I try to use the definitions
Element
= tagInfos:StartTag
& {
@knownNamespaces.push(tagInfos.namespaces)
prefix = tagInfos.qid.prefix
if (@isKnownNamespace(prefix) == false)
error("unknown namespace prefix '" + prefix + "'")
true
}
ElementContent*
& {
@knownNamespaces.pop()
}
qid:EndTag
{ if ( tagInfos.qid.full != qid.full ) then expected "that start and end tag must be identical" }
In the final action I can access, e.g. @knownNamespaces, but not in the predicates!?!
Any help?
thanks,
Jan
This is my initializer in the .pegcoffee file
When I try to use the definitions
In the final action I can access, e.g. @knownNamespaces, but not in the predicates!?!
Any help?
thanks,
Jan