-
Notifications
You must be signed in to change notification settings - Fork 624
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
introduce sub parser #64
Comments
so kind of like vim and emacs modelines? |
Very different. Example: int c parser can pick "main" and store it to tags file. |
This is related to #80. There are interesting lexers in pytments:
I guess more that two lexers can be combined. |
Now I understand recording |
Yes, it's supposed to be replaced with the value of |
php+javascript, we have both. But we don't have a combine them. I can generalize this issue.
We don't have a memory stream. We need it. |
Here's another example:
This is really not a good practice for PHP anymore, but it works, so maybe ctags should support it? Here's another common scenario:
This second example is much more common. I'm not sure that it's absolutely necessary for parsers to handle things differently in either of these scenarios, though. I should just be able to run the PHP parser on the first example and get back what I expect, and the Javascript parser should tolerate the second example. If I have both PHP and Javascript in the same file like that, then I should just be able to run both parsers over the same file and get back something reasonable. |
Very attractive. This kind of example will defer the release:-P Currently the most of all parsers keep the state of parsing as file local variables. The state of input stream can be stacked... BTW, when submitting an example, I recommend you to submit an expected tags, too if possible. |
@masatake I'm saying that we shouldn't need to do that. One parser doesn't need to call another parser. We just need to be able to say "Run this set of parsers on this particular file type.", probably through a CLI switch (instead of doing it be default). I might be a bad developer and have This is definitely not needed for 1.0.0, I think. |
ctags is used behind opengrok and debian code search. And this is the area I'm interested in. |
Now we have mio.
If you are interested in working on these area, tell me. I will work on |
See #875. Running a specified parser in an area of input can be scheduled. For the feature I will introduce new API set called "promise". A parser make a promise during paring. For making a promise, the parser specifies the start of the area, the end of the area, and the name of parser which parses the area. After the current parser finishes parsing the input, ctags checks the backlog of promises made by the last parser. If there is more than one promise, ctags forces the promises: making a sub stream from the start and end information of the promise and invoking the parser specified with the name in the promise on the sub stream. |
There is no way to pass data from parent to its children but promise works well. |
Suppress warnings [-Wpointer-sign]
739b3ee9e Fix argument type mismatch 150372de0 Merge branch 'feature/memory-recycling' 142660fb1 Reduce memory allocation frequency b3f745496 Add a typecast and const modifiers 176f5c0f8 Simplify the code using pcc_context_t typedef 4dbcaae48 Rename identifiers related to memory recycling 08a6f0c56 Merge branch 'master' into feature/memory-recycling 3a0ecca3f Rename macros in generated parsers e50f8b233 Merge pull request universal-ctags#63 from masatake/recycle-list 58ad04747 Merge pull request universal-ctags#64 from dolik-rce/benchmark-memory e559f4c4e add memory measurement to benchmark script f3a5c7e77 Preallocate memory objects for pcc_thunk_chunk_t, pcc_lr_head_t, and pcc_lr_answer_t 7cd6dffb7 Pass pcc_context_t instead of pcc_auxil_t in many places 710b51f7f Update the copyright years 70389ec19 Conform to the coding style 59668cf87 Divide the character_classes_0.d test into two tests 657508c52 Merge pull request universal-ctags#61 from mingodad/fix-charset-plus-minus 572951a8c Fix handling charset "[+-]" 0e3ee0c8b Update README.md 03c90e03e Fix the reopened issue universal-ctags#56 c2f499eb2 Ensures that all values of unevaluated rules are zero-cleared f376e099d Support exact column numbers in the PEG source even if UTF-8 multibyte characters are contained 9dfcd9153 Modify a dump function e27c05d91 Add codes for safety da750a9a7 Refine code block output afd64bc61 Update README.md cea483b89 Support insertion of #line directives in the generated code (universal-ctags#55) 62130fe96 Add a feature to count text lines output to a stream 4982d72ea Introduce a structure to hold code block data 86874c214 Fix incorrect update of the parsing position 41be80f02 Introduce a structure to hold options 5b9f23d18 Rename functions 803317bc4 Update README.md git-subtree-dir: misc/packcc git-subtree-split: 739b3ee9edd62b8623d30272069e6fd446270591
739b3ee9e Fix argument type mismatch 150372de0 Merge branch 'feature/memory-recycling' 142660fb1 Reduce memory allocation frequency b3f745496 Add a typecast and const modifiers 176f5c0f8 Simplify the code using pcc_context_t typedef 4dbcaae48 Rename identifiers related to memory recycling 08a6f0c56 Merge branch 'master' into feature/memory-recycling 3a0ecca3f Rename macros in generated parsers e50f8b233 Merge pull request universal-ctags#63 from masatake/recycle-list 58ad04747 Merge pull request universal-ctags#64 from dolik-rce/benchmark-memory e559f4c4e add memory measurement to benchmark script f3a5c7e77 Preallocate memory objects for pcc_thunk_chunk_t, pcc_lr_head_t, and pcc_lr_answer_t 7cd6dffb7 Pass pcc_context_t instead of pcc_auxil_t in many places 710b51f7f Update the copyright years 70389ec19 Conform to the coding style 59668cf87 Divide the character_classes_0.d test into two tests 657508c52 Merge pull request universal-ctags#61 from mingodad/fix-charset-plus-minus 572951a8c Fix handling charset "[+-]" 0e3ee0c8b Update README.md 03c90e03e Fix the reopened issue universal-ctags#56 c2f499eb2 Ensures that all values of unevaluated rules are zero-cleared f376e099d Support exact column numbers in the PEG source even if UTF-8 multibyte characters are contained 9dfcd9153 Modify a dump function e27c05d91 Add codes for safety da750a9a7 Refine code block output afd64bc61 Update README.md cea483b89 Support insertion of #line directives in the generated code (universal-ctags#55) 62130fe96 Add a feature to count text lines output to a stream 4982d72ea Introduce a structure to hold code block data 86874c214 Fix incorrect update of the parsing position 41be80f02 Introduce a structure to hold options 5b9f23d18 Rename functions 803317bc4 Update README.md git-subtree-dir: misc/packcc git-subtree-split: 739b3ee9edd62b8623d30272069e6fd446270591
739b3ee9e Fix argument type mismatch 150372de0 Merge branch 'feature/memory-recycling' 142660fb1 Reduce memory allocation frequency b3f745496 Add a typecast and const modifiers 176f5c0f8 Simplify the code using pcc_context_t typedef 4dbcaae48 Rename identifiers related to memory recycling 08a6f0c56 Merge branch 'master' into feature/memory-recycling 3a0ecca3f Rename macros in generated parsers e50f8b233 Merge pull request universal-ctags#63 from masatake/recycle-list 58ad04747 Merge pull request universal-ctags#64 from dolik-rce/benchmark-memory e559f4c4e add memory measurement to benchmark script f3a5c7e77 Preallocate memory objects for pcc_thunk_chunk_t, pcc_lr_head_t, and pcc_lr_answer_t 7cd6dffb7 Pass pcc_context_t instead of pcc_auxil_t in many places 710b51f7f Update the copyright years 70389ec19 Conform to the coding style 59668cf87 Divide the character_classes_0.d test into two tests 657508c52 Merge pull request universal-ctags#61 from mingodad/fix-charset-plus-minus 572951a8c Fix handling charset "[+-]" 0e3ee0c8b Update README.md 03c90e03e Fix the reopened issue universal-ctags#56 c2f499eb2 Ensures that all values of unevaluated rules are zero-cleared f376e099d Support exact column numbers in the PEG source even if UTF-8 multibyte characters are contained 9dfcd9153 Modify a dump function e27c05d91 Add codes for safety da750a9a7 Refine code block output afd64bc61 Update README.md cea483b89 Support insertion of #line directives in the generated code (universal-ctags#55) 62130fe96 Add a feature to count text lines output to a stream 4982d72ea Introduce a structure to hold code block data 86874c214 Fix incorrect update of the parsing position 41be80f02 Introduce a structure to hold options 5b9f23d18 Rename functions 803317bc4 Update README.md git-subtree-dir: misc/packcc git-subtree-split: 739b3ee9edd62b8623d30272069e6fd446270591
Consider running ctags against a source tree that uses autotools as its build system.
Which parser should be used for foo.h.in?
Of course C (or objc) parser should be used first of all.
Is it enough?
How about @Package@ or something in the file?
@foo@ is place holder used in autotools. I hope these are also tagged by ctags.
I would like to run the second priority parser(sub parser)something "template-of-configure-output".
The sub parser is activated for files globbed "*.in".
Suprisingly ctags has enough ability to run ,multi-path parser. We can use this function to run sub-parser.
The text was updated successfully, but these errors were encountered: