From ae46592c0a56dc82d8cebd4b23afd2bfde5d9ec4 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 15 Mar 2024 08:48:11 +0900 Subject: [PATCH] [WIP] Tmain: add a case testing operators for boolean fields Signed-off-by: Masatake YAMATO --- .../input.unknownx | 2 ++ .../knownz.ctags | 3 +++ .../stdout-expected.txt | 3 +++ .../unknownx.ctags | 19 +++++++++++++++++++ 4 files changed, 27 insertions(+) diff --git a/Tmain/parser-own-fields-for-foreign-lang.d/input.unknownx b/Tmain/parser-own-fields-for-foreign-lang.d/input.unknownx index 4c251355a7..457e8e343d 100644 --- a/Tmain/parser-own-fields-for-foreign-lang.d/input.unknownx +++ b/Tmain/parser-own-fields-for-foreign-lang.d/input.unknownx @@ -4,3 +4,5 @@ private func baz(n,...); X:tagme@iamowner Y:iamowner2=tagme2 Z:tagme-z@iamowner-z +eset:a +enoset:b diff --git a/Tmain/parser-own-fields-for-foreign-lang.d/knownz.ctags b/Tmain/parser-own-fields-for-foreign-lang.d/knownz.ctags index 64d83ce557..92799bce41 100644 --- a/Tmain/parser-own-fields-for-foreign-lang.d/knownz.ctags +++ b/Tmain/parser-own-fields-for-foreign-lang.d/knownz.ctags @@ -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} diff --git a/Tmain/parser-own-fields-for-foreign-lang.d/stdout-expected.txt b/Tmain/parser-own-fields-for-foreign-lang.d/stdout-expected.txt index ae2927f88e..9dbb6a1552 100644 --- a/Tmain/parser-own-fields-for-foreign-lang.d/stdout-expected.txt +++ b/Tmain/parser-own-fields-for-foreign-lang.d/stdout-expected.txt @@ -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) diff --git a/Tmain/parser-own-fields-for-foreign-lang.d/unknownx.ctags b/Tmain/parser-own-fields-for-foreign-lang.d/unknownx.ctags index 6b70c64c23..fed79e76fa 100644 --- a/Tmain/parser-own-fields-for-foreign-lang.d/unknownx.ctags +++ b/Tmain/parser-own-fields-for-foreign-lang.d/unknownx.ctags @@ -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} @@ -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 +}}