You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fix] EnclosedExpression in element constructor with location
- In XQuery.g: copy lexer info (location) of enclosed expression to
compElementConstructorContent, if present.
Add virtual parenthesized expression otherwise, evaluating to
`element test { () }`
- Set AST node of enclosed expression in computed element constructor
in XQueryTree.g
- Adapt jUnit-tests to:
1. Ensure enclosed expression location is reported.
2. Ensure arrays are allowed as computed element constructor content.
finalStringquery = "element test { array { () } }";
51
+
assertCompilationSuccess(query);
47
52
}
48
53
54
+
49
55
@Test
50
56
publicvoidpartialBuiltIn() throwsXMLDBException {
51
57
finalStringquery = "element test { sum(?) }";
52
-
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got function(*) [at line 1, column 14, source: element test { sum(?) }]";
58
+
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got function(*) [at line 1, column 16, source: element test { sum(?) }]";
finalStringquery = "element test { function () { () } }";
59
-
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got function(*) [at line 1, column 14, source: element test { function () { () } }]";
finalStringquery = "element test { array { () } }";
66
-
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got array(*) [at line 1, column 14, source: element test { array { () } }]";
65
+
// TODO: user defined function has its location offset to a weird location
66
+
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got function(*) [at line 1, column 25, source: element test { function () { () } }]";
67
67
assertCompilationError(query, error);
68
68
}
69
69
70
70
@Test
71
71
publicvoidmapConstructor() throwsXMLDBException {
72
72
finalStringquery = "element test { map {} }";
73
-
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got map(*) [at line 1, column 14, source: element test { map {} }]";
73
+
finalStringerror = "err:XQTY0105 Function types are not allowed in element content. Got map(*) [at line 1, column 16, source: element test { map {} }]";
0 commit comments