-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2796 from bernardjosef/extra-mtable-regex
Extra mtable regex
- Loading branch information
Showing
6 changed files
with
71 additions
and
0 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,3 @@ | ||
(def a) | ||
{def b} | ||
[def c] |
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,23 @@ | ||
--langdef=MTExtra | ||
--map-MTExtra=+.mtextra | ||
|
||
--kinddef-MTExtra=d,def,definitions | ||
|
||
# [] | ||
--_extradef-MTExtra=acceptSquareBracket,accept square bracket | ||
# {} | ||
--_extradef-MTExtra=acceptCurlyBracket,accept curly bracket | ||
|
||
|
||
--_tabledef-MTExtra=main | ||
--_tabledef-MTExtra=body | ||
|
||
--_mtable-regex-MTExtra=main/\(def +//{tenter=body} | ||
--_mtable-regex-MTExtra=main/\[def +//{tenter=body}{_extra=acceptSquareBracket} | ||
--_mtable-regex-MTExtra=main/\{def +//{tenter=body}{_extra=acceptCurlyBracket} | ||
--_mtable-regex-MTExtra=main/.// | ||
|
||
--_mtable-regex-MTExtra=body/([_a-z]+)\)/\1/d/{tleave} | ||
--_mtable-regex-MTExtra=body/([_a-z]+)\]/\1/d/{tleave}{_extra=acceptSquareBracket} | ||
--_mtable-regex-MTExtra=body/([_a-z]+)\}/\1/d/{tleave}{_extra=acceptCurlyBracket} | ||
--_mtable-regex-MTExtra=body/.// |
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,29 @@ | ||
# Copyright: 2020 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
CTAGS="$1" | ||
|
||
msgstr () | ||
{ | ||
if [ $1 = '+' ]; then | ||
echo "enabled" | ||
else | ||
echo "disabled" | ||
fi | ||
} | ||
|
||
run_ctags () | ||
{ | ||
printf '# []: %s, {}: %s\n' $(msgstr $1) $(msgstr $2) | ||
${CTAGS} --quiet --options=NONE --options=mtextra.ctags \ | ||
--fields=+'{extras}' \ | ||
--extras-MTExtra=${1}'{acceptSquareBracket}' \ | ||
--extras-MTExtra=${2}'{acceptCurlyBracket}' \ | ||
-o - \ | ||
input.mtextra | ||
} | ||
|
||
run_ctags + + | ||
run_ctags - - | ||
run_ctags + - | ||
run_ctags - + |
Empty file.
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,12 @@ | ||
# []: enabled, {}: enabled | ||
a input.mtextra /^(def a)$/;" d | ||
b input.mtextra /^{def b}$/;" d extras:acceptCurlyBracket | ||
c input.mtextra /^[def c]$/;" d extras:acceptSquareBracket | ||
# []: disabled, {}: disabled | ||
a input.mtextra /^(def a)$/;" d | ||
# []: enabled, {}: disabled | ||
a input.mtextra /^(def a)$/;" d | ||
c input.mtextra /^[def c]$/;" d extras:acceptSquareBracket | ||
# []: disabled, {}: enabled | ||
a input.mtextra /^(def a)$/;" d | ||
b input.mtextra /^{def b}$/;" d extras:acceptCurlyBracket |
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