Skip to content

Commit

Permalink
[WIP] Tmain: add a case testing operators for boolean fields
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Mar 15, 2024
1 parent 1f073fc commit cbdc8c8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Tmain/parser-own-fields-for-foreign-lang.d/input.unknownx
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ private func baz(n,...);
X:tagme@iamowner
Y:iamowner2=tagme2
Z:tagme-z@iamowner-z
eset:a
enoset:b
3 changes: 3 additions & 0 deletions Tmain/parser-own-fields-for-foreign-lang.d/knownz.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
--fields-knownz=+{len}
--_fielddef-knownz=lenplus,the length of owner string + 1{datatype=int}
--fields-knownz=+{lenplus}

--_fielddef-knownz=exported,whether the marker is exported or not{datatype=bool}
--fields-knownz=+{exported}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
7_exported input.unknownx /^enoset:b$/;" m language:knownz
a input.unknownx /^eset:a$/;" m language:knownz exported:t
b input.unknownx /^enoset:b$/;" m language:knownz exported:
bar input.unknownx /^protected func bar(n);$/;" f language:unknownx protection:protected signature:(n)
baz input.unknownx /^private func baz(n,...);$/;" f language:unknownx protection:private signature:(n,...)
foo input.unknownx /^public func foo(n, m);$/;" f language:unknownx protection:public signature:(n, m)
Expand Down
19 changes: 19 additions & 0 deletions Tmain/parser-own-fields-for-foreign-lang.d/unknownx.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
--_fielddef-unknownx=protection,protections
--_fielddef-unknownx=signature,signatures

--_prelude-unknownx={{
/exported false def
}}

--regex-unknownx=/^((public|protected|private) +)?func ([^\(]+)\((.*)\)/\3/f/{_field=protection:\1}{_field=signature:(\4)}
--regex-unknownx=/^X:([a-z]+)@([a-z]+)/\1/m/{_language=knownz}{_field=owner:\2}
--regex-unknownx=/^Y:([a-z0-9]+)=([a-z0-9]+)/\2/m/{_field=owner:\1}{_language=knownz}
Expand All @@ -18,3 +22,18 @@
. exch knownz.lenplus:
} if
}}

--regex-unknownx=/^eset:([-a-z]+)/\1/m/{_language=knownz}{{
/exported . def
. true knownz.exported:
}}

--regex-unknownx=/^enoset:([-a-z]+)/\1/m/{_language=knownz}{{
. false knownz.exported:
exported :knownz.exported and {
mark exported 0 string cvs (_exported) _buildstring
/knownz
/mark
1@ _foreigntag _commit pop
} if
}}

0 comments on commit cbdc8c8

Please sign in to comment.