Commit eefd201b authored by Anthony LICK's avatar Anthony LICK

Restrict last expressions for downward and forward

'int' are not allowed anymore in last operations for these fragments
parent 56105a8e
......@@ -35,7 +35,6 @@ last.fun = element functionCallExpr {
},
element arguments { empty }?
}
| int
# Allowed axes before a [last()] predicate.
# Should be modified to a safe value when including this file.
......
# XPath fragment of XQueryX in Relax NG compact syntax
# Xpath expressions involving the function last() and intergers.
#
# Copyright (C) 2016-2017
# David Baelde, Anthony Lick and Sylvain Schmitz (ENS Cachan)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
default namespace = "http://www.w3.org/2005/XQueryX"
namespace xqx = "http://www.w3.org/2005/XQueryX"
include "last.rnc"
last.fun |= int
......@@ -27,7 +27,7 @@ include "xpath-1.0-core-join.rnc" {
# primary |= varref
# join.primary |= varref
include "expr/last.rnc" {
include "expr/last_first.rnc" {
last.axis = axis
}
last.primary |= varref
......
......@@ -24,7 +24,7 @@ include "xpath-1.0-core-basic.rnc" {
}
# Allowing some use of last()
include "expr/last.rnc" {
include "expr/last_first.rnc" {
# Allowed axes before a [last()] predicate.
last.axis = axis # We have Regular XPath
}
......
......@@ -30,7 +30,7 @@ include "xpath-1.0-vertical-id.rnc" {
}
# Allowing some use of last()
include "expr/last.rnc" {
include "expr/last_first.rnc" {
# Allowed axes before a [last()] predicate.
last.axis = deterministic.axis | element xpathAxis {
string "ancestor" # With 'parent' and regular XPath
......
......@@ -24,7 +24,7 @@ include "xpath-1.0-vertical-basic.rnc" {
}
# Allowing some use of last()
include "expr/last.rnc" {
include "expr/last_first.rnc" {
# Allowed axes before a [last()] predicate.
last.axis = deterministic.axis | element xpathAxis {
string "ancestor" # With 'parent' and regular XPath
......
......@@ -42,5 +42,5 @@ op |= element ( intersectOp | exceptOp # path intersection
}
# Allow last() on arbitrary paths
include "expr/last.rnc"
include "expr/last_first.rnc"
predicates |= last.predicate
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment