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

inspect:inspect-module($module) break on '@', '%', etc #1386

Open
duncdrum opened this issue Mar 28, 2017 · 4 comments
Open

inspect:inspect-module($module) break on '@', '%', etc #1386

duncdrum opened this issue Mar 28, 2017 · 4 comments
Labels
bug issue confirmed as bug

Comments

@duncdrum
Copy link
Contributor

duncdrum commented Mar 28, 2017

What is the problem

xqDoc annotations that contain an @ are not processed correctly by inspect:inspect-module the fault is somewhere here i guess exist/src/org/exist/xquery/functions/inspect/InspectModule.java

What did you expect

@see or @returns comments can contain @ as part of the annotation, (email address and attributes) but the function stops at the character immediately before the @

Describe how to reproduce or add a test

add xqDoc comment to function and run inspect:inspect-module on the module, e.g.:

(:~
: this …
: @return taxonomy[@type = "reign"]
:)

will become

 <returns type="item()" cardinality="zero or more"> taxonomy[</returns>

instead of:

 <returns type="item()" cardinality="zero or more">taxonomy[@type = "reign"]</returns>

Context information

Please always add the following information

  • eXist-db version 3.1.1
  • Java8u121
  • MacOs 10.12.4
  • 64 bit
@duncdrum duncdrum changed the title inspect:inspect-module($module) break on '@' exist/src/org/exist/xquery/functions/inspect/InspectModule.java inspect:inspect-module($module) break on '@' Mar 28, 2017
@duncdrum duncdrum changed the title inspect:inspect-module($module) break on '@' inspect:inspect-module($module) break on '@', '%', etc Aug 8, 2017
@duncdrum
Copy link
Contributor Author

duncdrum commented Aug 8, 2017

see also this tread from exist-open there are more problems with xqdoc annotations and special characters

@kohsah
Copy link

kohsah commented Aug 8, 2017

Same issue applies to % directives in the functions, where it simply fails.

I think the lexer needs to be updated here : https://github.com/eXist-db/exist/tree/develop/src/org/exist/xquery/xqdoc/parser

@adamretter
Copy link
Contributor

adamretter commented Aug 14, 2017

@kohsah Okay you are right the Lexer does need to be updated. I had a brief attempt this morning and failed. Sadly I am not very familiar with Antlr2, perhaps @wolfgangmm or @ljo could make the small necessary changes?

@duncdrum I just want to point out something that may be confusing. If you are using inspect:inspect-module this uses eXist's own XQDocParser as found here: https://github.com/eXist-db/exist/tree/develop/src/org/exist/xquery/xqdoc/parser

However if you are using the XQDoc extension module, i.e. xqdm.scan then that uses the XQDocParser from the xqdoc.org project, which is only designed for XQuery 1.0.

I would also note that the output documents of inspect:inspect-module and xqdm:scan are different which likely further causes confusion. I personally think that both should be standardised on the updated Schema provided by @ChristianGruen here http://xqdoc.org/xqdoc-1.0.01132014.xsd

@joewiz joewiz added the triage issue needs to be investigated label Sep 17, 2018
@duncdrum duncdrum added the bug issue confirmed as bug label Jan 11, 2019
@triage-new-issues triage-new-issues bot removed the triage issue needs to be investigated label Jan 11, 2019
@duncdrum
Copy link
Contributor Author

@lcahlander since your recent work in this area, tagging you here for future reference. Any comments welcome.

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

No branches or pull requests

4 participants