-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lregex: provide the way to intercept a parser making a tag
TODO: - write about the new option in docs/optlib.rst. - add --_makeTagEntryNotification-<LANG>={{...}}. Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
14 changed files
with
156 additions
and
6 deletions.
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,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 exch . exch 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
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