-
Notifications
You must be signed in to change notification settings - Fork 622
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
main: experimental implementation of multi-pass parsing #2741
base: master
Are you sure you want to change the base?
Conversation
|
563d0a2
to
eb456c7
Compare
581d43f
to
8f66fcc
Compare
Codecov Report
@@ Coverage Diff @@
## master #2741 +/- ##
==========================================
- Coverage 87.38% 86.95% -0.44%
==========================================
Files 199 194 -5
Lines 47769 41114 -6655
==========================================
- Hits 41743 35749 -5994
+ Misses 6026 5365 -661
Continue to review full report at Codecov.
|
Random ideas: The option
ctags must reject specifying the same file for output and hint. Should I compare their inode numbers? more API for parsers:
Just after opening a hint file, the main part of ctags should notify it to parsers that have a method
This helps a parser build including/included (, require/provide, use/used, or import/package) relation graph before parsing. How about introducing tags.c, a parser for tags.
ctags parses a.tags. When ctags find The code for realizing the multi-pass parsing and for updating a tags file are strongly related. But how? Linking libreadtags proposed here is obviously needed for both features. For implementing "updating a tags file", I must revise the way of output. When using a hint file, ctags must compare the options used for generating the hint file and the options just passed from the user. Comparing options is basic infrastructure for running ctags parsers parallel. To support the other types of hint files, ctags must verify the type of the hint file with filename extension and pattern as ctags does for detecting a suitable parser for an input source file. If querying hints is not done at hotspots, we can reuse the query engine used in the readtags command. |
7341933
to
4aef85d
Compare
I applied
I used the ctags command with my experimental patch to make tags for Qemu source code that I'm reading now.
About 70 times slower. |
I implemented negative hint cache.
7 times faster than the version without the negative hint cache. |
This is related to #1960. |
This change is preparation for adding features querying existing tags files during parsing. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…e name defined in libreadtags Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
An option, --_hint-file=<tags-file> is also added. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…le is given As the first pass, make a tags file with --fields=+{language}. In the second pass, specified the tags file created in the first pass with --_hint-file=<tags file>. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…a hint file Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… hint file Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… not in a hint file Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… hint file Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… language doesn't enable symtab LDScript and Asm parsers use CPreProcessor parser code. However, they don't turn on their symtabs because they are not ready for utilize macro expanding feature. If CPreProcessor called symtab related functions, ctags crashed because there was no symtab. With this change, ctags can avoid the crash. CPreProcessor parser calls the symtab related functions only when the client language enables its symtab. TODO: TEST CASE IS NEEDED. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
e5d7ced must be included in ctags6. |
This pull request introduces
--_hint=<tag file>
option and internal APIs for utilizing the given tags file.A parser can use the pre-existing tags file for improving the quality of parsing and tagging with the APIs.
This option is not for incremental updating.
Even you specify
--_hint=<tag file>
, ctags parsers all input files.Python parser is the initial target for applying the APIs.
In the first pass, the Python parser attaches "unknown" kind to X in "from Y import X".
With the hint, the Python parser can resolve the real kind for X.