-
Notifications
You must be signed in to change notification settings - Fork 619
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
xpath metaparser based on libxml2 #740
Conversation
96091f7
to
2e28ff4
Compare
Remove unnecessary white spaces.. |
For extension ".xml" we need a good selector. |
xmlNode *root; | ||
xmlXPathContextPtr ctx; | ||
|
||
findRegexTags (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, for the doctype extraction in the example. sounds a bit hacky, couldn't this be extracted with an Xpath that could get installed at runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive the regex parser here.
See Units/simple-glade.d/args.ctags in these commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just an example. What I want to say is that calling findRegexTags is meaningful; it allows a user doing something hacky.
Scope is added but the interface between a concrete parser and xpath meta parser becomes ugly.
It seems much more work is needed... |
264b053
to
1663ed3
Compare
2ac7653
to
86e956a
Compare
The interface of xpath meta parser is updated as @b4n suggested. |
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…ition of input file libxml2, which will be used in xpath metaparser, can tell the line number for a xml node. However, ctags requires the file position for a tag when recording. Newly introduced a data structure and functions will fill this gap. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
TODO: qualified-tags Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Experimental. Testing for new xpath metaparser. TODO: scope field. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…le contents Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Many of XML meta parser based parsers may have the same extension: xml. New selector, selectByDTD is for selecting a proper parser for the xml file. This implementation is not efficient; it crates an dom tree for selecting. The dom tree should be reused in the selected parser. This implementation is ugly; per concrete parser rules for selecting are hard-coded in selectByDTD. These rules should be in parserDefinitions. Making a XML dom tree from input memory area should be generalized. So it can be used another areas of ctags. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
I added import(i) kind to ant parser in b1fa747. This is a wrong commit now; the imported file should be recorded as a reference tag. However, current regex meta parser cannot make a reference tag. So I remove it. Fortunately exuberant-ctags doesn't have import kind. Therefore this removal doesn't break compatibility. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…cified feature Units/TEST/features was introduced to specify features needed to run the TEST case. This commit introduces a marker for skipping a test case if ctags HAS a specified feature; the test is skipped if a line of the file is started with ``!`` marker, and a target ctags have the feature specified with ``!``. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
scope field is implemented in this xpath based parser. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
xpath metaparser based on libxml2
ant.c can be rewritten with xpath metaparser.