Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error (VarRef) passing string to be parsed #5

Open
apb2006 opened this issue Aug 15, 2022 · 3 comments
Open

Type error (VarRef) passing string to be parsed #5

apb2006 opened this issue Aug 15, 2022 · 3 comments

Comments

@apb2006
Copy link
Member

apb2006 commented Aug 15, 2022

Stopped at C:/Users/andy/basex.home/repo/http-expkg-zone58.github.io-ex-xparse-0.6.14/content/xparse.xqm, 1/70:
[XPTY0004] expkg_zone58.text.parse.Parse_BaseX:parseXQuery(xs:string) expected, (VarRef) found.
- C:/Users/andy/basex.home/repo/http-expkg-zone58.github.io-ex-xparse-0.6.14/content/xparse.xqm, 45/22
@apb2006
Copy link
Member Author

apb2006 commented Aug 15, 2022

Seems to be a change in the handling of closures here:

https://github.com/expkg-zone58/ex-xparse/blob/master/src/main/content/xparse.xqm#L96-L105

The new Parse_BaseX.jar works when called directly

Q{java:expkg_zone58.text.parse.Parse_BaseX}parseXQuery("if (true()) then 7 ")

@apb2006
Copy link
Member Author

apb2006 commented Aug 16, 2022

This works

declare function local:foo() as function(*)
{
  let $code:=``[function($src as xs:string){Q{java:java.lang.String}length($src)}]``
  return xquery:eval($code)
};

Q{java:java.lang.String}length("abc")
, local:foo()("abc")

Maybe problem is with org.basex.query.value.item.Str
https://github.com/expkg-zone58/ex-xparse/blob/master/src/java/Parse_XQDocComments.java#L174

apb2006 added a commit that referenced this issue Aug 16, 2022
@apb2006
Copy link
Member Author

apb2006 commented Nov 17, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant