-
Notifications
You must be signed in to change notification settings - Fork 628
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: introduce --_makeTagEntryReflection-<LANG> option to filter tags #3027
Draft
masatake
wants to merge
5
commits into
universal-ctags:master
Choose a base branch
from
masatake:makeTagEntryReflection
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
54f48b5
prelude: add _endwith procedure
masatake 54733ef
optscript: introduce _strrpbrk operator
masatake 82561b0
optscript: introduce opt_dict_known_and_get as new C API
masatake cd7e273
main: make optscript{Setup,Teardown} reentrant
masatake ff6417f
lregex: provide the way to intercept a parser making a tag
masatake File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
true | ||
false | ||
false | ||
false | ||
true | ||
true | ||
true |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# See #3020 and #3027. | ||
|
||
--sort=no | ||
--extras=+q | ||
|
||
--_extradef-Markdown=withfname,appending input filename | ||
--extras-Markdown=+{withfname} | ||
|
||
--_prelude-Markdown={{ | ||
% You can customize the string combining the original name | ||
% and the basen name of input file. | ||
/SEP (@) def | ||
|
||
% dict<original-index:int, withfname-index:int> | ||
/scope-remapping-table 31 dict def | ||
|
||
% (abc/input.d) dropext => (abc/input) | ||
% (abc.d/input) dropext => (abc.d/input) | ||
/dropext { | ||
(/.) _strrpbrk { | ||
% string offset | ||
2 copy get ?/ eq { | ||
pop | ||
} { | ||
0 exch 0 string _copyinterval | ||
} ifelse | ||
} if | ||
} def | ||
|
||
% (abc/efg) basename => (efg) | ||
/basename { | ||
?/ _strrchr { | ||
1 add dup 2 index length exch sub | ||
0 string _copyinterval | ||
} if | ||
} def | ||
}} | ||
|
||
--_sequel-Markdown={{ | ||
% Fill the scope field of withfname extra tags. | ||
scope-remapping-table { | ||
% Make the original tag invisible | ||
exch dup _markplaceholder | ||
:scope dup | ||
% withfname-index:int original-scope:int original-scope:int | ||
0 eq { | ||
pop pop | ||
} { | ||
% withfname-index:int original-scope:int | ||
scope-remapping-table exch get | ||
% withfname-index:int withfname-scope:int | ||
scope: | ||
} ifelse | ||
} forall | ||
}} | ||
|
||
--_makeTagEntryReflection-Markdown={{ | ||
/Markdown.withfname _extraenabled { | ||
. :extras { | ||
/Markdown.withfname _amember not | ||
} { | ||
true | ||
} ifelse | ||
{ | ||
mark | ||
. :name | ||
SEP | ||
. :input dropext basename | ||
_buildstring | ||
|
||
. :kind | ||
. _tagloc _tag dup /Markdown.withfname _markextra | ||
_commit | ||
% Record the pair of original-index:int and withfname-index:int. | ||
scope-remapping-table . 3 -1 roll put | ||
} if | ||
|
||
} if | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ABC@input input.md /^# ABC$/;" c | ||
DEF@input input.md /^## DEF$/;" s chapter:ABC@input | ||
GHI@input input.md /^### GHI$/;" S section:ABC@input""DEF@input | ||
HIJ@input input.md /^### HIJ$/;" S section:ABC@input""DEF@input | ||
KLM@input input.md /^## KLM$/;" s chapter:ABC@input | ||
OPQ@input input.md /^# OPQ$/;" c | ||
RST@input input.md /^### RST$/;" S chapter:OPQ@input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# ABC | ||
|
||
## DEF | ||
|
||
### GHI | ||
|
||
### HIJ | ||
|
||
## KLM | ||
|
||
# OPQ | ||
|
||
### RST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
_strendwith
may be better name.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.
Using _strrstr is one of the ways to shorten the proc.
Writing in C is another choice.