Skip to content

Commit 123588e

Browse files
authored
Merge pull request #3960 from masatake/main--foreign-fields
optlib: allow users to set fields and check extras defined in a foreign language
2 parents 23c6e36 + d87078d commit 123588e

File tree

41 files changed

+1007
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1007
-99
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#LETTER NAME ENABLED LANGUAGE JSTYPE FIXED OP DESCRIPTION
2-
- boolfield no FIELDTEST --b no -- a field having boolean value
2+
- boolfield no FIELDTEST --b no rw a field having boolean value
33
- deffield no FIELDTEST s-- no -- a field that type is not specified
4-
- intfield no FIELDTEST -i- no -- a field having integer value
5-
- strboolfield no FIELDTEST s-b no -- a field having string value or false
6-
- strfield no FIELDTEST s-- no -- a field having string value
4+
- intfield no FIELDTEST -i- no rw a field having integer value
5+
- strboolfield no FIELDTEST s-b no rw a field having string value or false
6+
- strfield no FIELDTEST s-- no rw a field having string value
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#LETTER NAME DESCRIPTION
2-
- datatype=TYPE acceaptable datatype of the field ([str]|bool|int|str+bool)
2+
- datatype=TYPE acceaptable datatype of the field (str|bool|int|str+bool)

Tmain/list-fields-with-prefix.d/stdout-expected.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,24 @@ x UCTAGSxpath no NONE s-- no -- xpath for
3131
- UCTAGShowImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')
3232
- UCTAGSpackage yes Go s-- no -- the real package specified by the package name
3333
- UCTAGSpackageName yes Go s-- no -- the name for referring the package
34-
- UCTAGSimplements yes Inko s-- no -- Trait being implemented
34+
- UCTAGSimplements yes Inko s-- no rw Trait being implemented
3535
- UCTAGSassignment yes LdScript s-- no -- how a value is assigned to the symbol
3636
- UCTAGSdefiner yes Lisp s-- no -- the name of the function or macro that defines the unknown/Y-kind object
3737
- UCTAGSsectionMarker no Markdown s-- no -- character used for declaring section(#, ##, =, or -)
3838
- UCTAGSwrapping yes Moose s-- no -- how a wrapper wrapping the method (around, after, or before)
3939
- UCTAGSlangid yes NSIS s-- no -- language identifier specified in (License)LangString commands
4040
- UCTAGScategory yes ObjectiveC s-- no -- category attached to the class
4141
- UCTAGSprotocols yes ObjectiveC s-- no -- protocols that the class (or category) confirms to
42-
- UCTAGShome yes Passwd s-- no -- home directory
43-
- UCTAGSshell yes Passwd s-- no -- login shell
42+
- UCTAGShome yes Passwd s-- no rw home directory
43+
- UCTAGSshell yes Passwd s-- no rw login shell
4444
- UCTAGSdecorators no Python s-- no -- decorators on functions and classes
4545
- UCTAGSnameref yes Python s-- no -- the original name for the tag
4646
- UCTAGSassignmentop no R s-- no -- operator for assignment
4747
- UCTAGSconstructor yes R s-- no -- function used for making value assigned to the nameattr tag
4848
- UCTAGSoverline no ReStructuredText --b no -- whether using overline & underline for declaring section
4949
- UCTAGSsectionMarker no ReStructuredText s-- no -- character used for declaring section
5050
- UCTAGSmixin yes Ruby s-- no -- how the class or module is mixed in (mixin:HOW:MODULE)
51+
- UCTAGSmodule yes SCSS s-- no rw the name of module behind the namespace
5152
- UCTAGSdefiner yes Scheme s-- no -- the name of the function or macro that defines the unknown/Y-kind object
5253
- UCTAGSparameter no SystemVerilog --b no -- parameter whose value can be overridden.
5354
- UCTAGStarget yes Thrift s-- no -- the target language specified at "namespace"

Tmain/list-fields.d/stdout-expected.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,24 @@ z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field outpu
4949
- howImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')
5050
- package yes Go s-- no -- the real package specified by the package name
5151
- packageName yes Go s-- no -- the name for referring the package
52-
- implements yes Inko s-- no -- Trait being implemented
52+
- implements yes Inko s-- no rw Trait being implemented
5353
- assignment yes LdScript s-- no -- how a value is assigned to the symbol
5454
- definer yes Lisp s-- no -- the name of the function or macro that defines the unknown/Y-kind object
5555
- sectionMarker no Markdown s-- no -- character used for declaring section(#, ##, =, or -)
5656
- wrapping yes Moose s-- no -- how a wrapper wrapping the method (around, after, or before)
5757
- langid yes NSIS s-- no -- language identifier specified in (License)LangString commands
5858
- category yes ObjectiveC s-- no -- category attached to the class
5959
- protocols yes ObjectiveC s-- no -- protocols that the class (or category) confirms to
60-
- home yes Passwd s-- no -- home directory
61-
- shell yes Passwd s-- no -- login shell
60+
- home yes Passwd s-- no rw home directory
61+
- shell yes Passwd s-- no rw login shell
6262
- decorators no Python s-- no -- decorators on functions and classes
6363
- nameref yes Python s-- no -- the original name for the tag
6464
- assignmentop no R s-- no -- operator for assignment
6565
- constructor yes R s-- no -- function used for making value assigned to the nameattr tag
6666
- overline no ReStructuredText --b no -- whether using overline & underline for declaring section
6767
- sectionMarker no ReStructuredText s-- no -- character used for declaring section
6868
- mixin yes Ruby s-- no -- how the class or module is mixed in (mixin:HOW:MODULE)
69+
- module yes SCSS s-- no rw the name of module behind the namespace
6970
- definer yes Scheme s-- no -- the name of the function or macro that defines the unknown/Y-kind object
7071
- parameter no SystemVerilog --b no -- parameter whose value can be overridden.
7172
- target yes Thrift s-- no -- the target language specified at "namespace"

Tmain/optscript.d/error-undefined-if-if.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ top| |bottom
44
Execution stack:
55
top| a {a} --if-- {true {a} if} --if-- |bottom
66
Dictionary stack:
7-
top| -dict:1- -dict:89- |bottom
7+
top| -dict:1- -dict:91- |bottom

Tmain/optscript.d/error-undefined-if.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ top| |bottom
44
Execution stack:
55
top| a {a} --if-- |bottom
66
Dictionary stack:
7-
top| -dict:1- -dict:89- |bottom
7+
top| -dict:1- -dict:91- |bottom
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public func foo(n, m);
2+
protected func bar(n);
3+
private func baz(n,...);
4+
STR:strset@iamowner
5+
STR:setsetempty@
6+
STR:notset
7+
Y:iamowner2=tagme2
8+
Z:tagme-z@iamowner-z
9+
eset:a
10+
enoset:b
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--langdef=knownz
2+
--kinddef-knownz=m,mark,makers
3+
4+
--_fielddef-knownz=owner,the owner of the markers{datatype=str}
5+
6+
--_fielddef-knownz=len,the length of owner string{datatype=int}
7+
--fields-knownz=+{len}
8+
--_fielddef-knownz=lenplus,the length of owner string + 1{datatype=int}
9+
--fields-knownz=+{lenplus}
10+
11+
--_fielddef-knownz=exported,whether the marker is exported or not{datatype=bool}
12+
--fields-knownz=+{exported}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright: 2025 Masatake YAMATO
2+
# License: GPL-2
3+
4+
. ../utils.sh
5+
6+
CTAGS=$1
7+
8+
V=
9+
# V=valgrind
10+
11+
is_feature_available "${CTAGS}" json
12+
13+
echo "# output: json"
14+
${V} ${CTAGS} --options=NONE --options=./knownz.ctags --sort=no --options=./unknownx.ctags \
15+
--fields=+l \
16+
--fields-unknownx=+'{protection}{signature}' \
17+
--fields-knownz=+'{owner}' \
18+
--output-format=json \
19+
-o - input.unknownx
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ctags: Notice: No options will be read from files or environment

0 commit comments

Comments
 (0)