-
Notifications
You must be signed in to change notification settings - Fork 630
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 #4178 from masatake/main--datatype-in-fielddef
main: provide the way to specify data taype in --_fielddef option
- Loading branch information
Showing
52 changed files
with
225 additions
and
12 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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 @@ | ||
0 |
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,22 @@ | ||
# Copyright: 2023 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
CTAGS=$1 | ||
|
||
${CTAGS} --quiet --options=NONE --langdef=FIELDTEST \ | ||
--_fielddef-FIELDTEST=strfield,"a field having string value"'{datatype=str}' \ | ||
--_fielddef-FIELDTEST=boolfield,"a field having boolean value"'{datatype=bool}' \ | ||
--_fielddef-FIELDTEST=intfield,"a field having integer value"'{datatype=int}' \ | ||
--_fielddef-FIELDTEST=strboolfield,"a field having string value or false"'{datatype=str+bool}' \ | ||
--_fielddef-FIELDTEST=deffield,"a field that type is not specified" \ | ||
--list-fields=FIELDTEST && \ | ||
! ${CTAGS} --quiet --options=NONE --langdef=FIELDTEST \ | ||
--_fielddef-FIELDTEST=fooA,"unexpected data type"'{datatype=bar}' && | ||
! ${CTAGS} --quiet --options=NONE --langdef=FIELDTEST \ | ||
--_fielddef-FIELDTEST=fooB,"unexpected data type"'{datatype=int+baz}' && | ||
! ${CTAGS} --quiet --options=NONE --langdef=FIELDTEST \ | ||
--_fielddef-FIELDTEST=fooC,"unexpected data type"'{datatype=}' && | ||
! ${CTAGS} --quiet --options=NONE --langdef=FIELDTEST \ | ||
--_fielddef-FIELDTEST=fooD,"unexpected data type"'{datatype=+baz}' && | ||
! ${CTAGS} --quiet --options=NONE --langdef=FIELDTEST \ | ||
--_fielddef-FIELDTEST=fooE,"unexpected data type"'{datatype=bool+str}' |
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,5 @@ | ||
ctags: unknown datatype for field "fooA": "bar" | ||
ctags: unknown datatype for field "fooB": "int+baz" | ||
ctags: no datatype given for field: "fooC" | ||
ctags: unknown datatype for field "fooD": "+baz" | ||
ctags: unknown datatype for field "fooE": "bool+str" |
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,6 @@ | ||
#LETTER NAME ENABLED LANGUAGE JSTYPE FIXED OP DESCRIPTION | ||
- boolfield no FIELDTEST --b no -- a field having boolean value | ||
- deffield no FIELDTEST s-- no -- a field that type is not specified | ||
- intfield no FIELDTEST -i- no -- a field having integer value | ||
- strboolfield no FIELDTEST s-b no -- a field having string value or false | ||
- strfield no FIELDTEST s-- no -- a field having string value |
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 @@ | ||
0 |
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 @@ | ||
#!/bin/sh | ||
# Copyright: 2023 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
CTAGS=$1 | ||
|
||
${CTAGS} --quiet --options=NONE --_list-fielddef-flags |
File renamed without changes.
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,2 @@ | ||
#LETTER NAME DESCRIPTION | ||
- datatype=TYPE acceaptable datatype of the field ([str]|bool|int|str+bool) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
0 |
17 changes: 17 additions & 0 deletions
17
Tmain/parser-specific-fields-with-datatype.d/input.testlang
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,17 @@ | ||
str:s0 | ||
str:s1 | ||
str:s2 | ||
|
||
int:i0 | ||
int:i1 | ||
int:i2 | ||
int:i3 | ||
int:i4 | ||
|
||
bool:b0 | ||
bool:b1 | ||
bool:b2 | ||
|
||
strbool:sb0 | ||
strbool:sb1 | ||
strbool:sb2 |
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,8 @@ | ||
# Copyright: 2025 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
CTAGS=$1 | ||
|
||
${CTAGS} --quiet --options=NONE --options=testlang.ctags -o - \ | ||
--output-format=u-ctags \ | ||
input.testlang |
Empty file.
14 changes: 14 additions & 0 deletions
14
Tmain/parser-specific-fields-with-datatype.d/stdout-expected.txt
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,14 @@ | ||
s0 input.testlang /^str:s0$/;" o str:string | ||
s1 input.testlang /^str:s1$/;" o str: | ||
s2 input.testlang /^str:s2$/;" o | ||
i0 input.testlang /^int:i0$/;" o int:10 | ||
i1 input.testlang /^int:i1$/;" o int:-1 | ||
i2 input.testlang /^int:i2$/;" o int:1 | ||
i3 input.testlang /^int:i3$/;" o int:0 | ||
i4 input.testlang /^int:i4$/;" o | ||
b0 input.testlang /^bool:b0$/;" o bool: | ||
b1 input.testlang /^bool:b1$/;" o bool: | ||
b2 input.testlang /^bool:b2$/;" o | ||
sb0 input.testlang /^strbool:sb0$/;" o strbool:abc | ||
sb1 input.testlang /^strbool:sb1$/;" o strbool: | ||
sb2 input.testlang /^strbool:sb2$/;" o |
33 changes: 33 additions & 0 deletions
33
Tmain/parser-specific-fields-with-datatype.d/testlang.ctags
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,33 @@ | ||
--sort=no | ||
|
||
--langdef=Testlang | ||
--map-Testlang=+.testlang | ||
|
||
--kinddef-Testlang=o,object,objects | ||
|
||
--_fielddef-Testlang=str,String{datatype=str} | ||
--fields-Testlang=+{str} | ||
--_fielddef-Testlang=int,Integer{datatype=int} | ||
--fields-Testlang=+{int} | ||
--_fielddef-Testlang=bool,Boolean{datatype=bool} | ||
--fields-Testlang=+{bool} | ||
--_fielddef-Testlang=strbool,String or Boolean{datatype=str+bool} | ||
--fields-Testlang=+{strbool} | ||
|
||
--regex-Testlang=/^str:(s0)/\1/o/{_field=str:string} | ||
--regex-Testlang=/^str:(s1)/\1/o/{_field=str:} | ||
--regex-Testlang=/^str:(s2)/\1/o/ | ||
|
||
--regex-Testlang=/^int:(i0)/\1/o/{_field=int:10} | ||
--regex-Testlang=/^int:(i1)/\1/o/{_field=int:-1} | ||
--regex-Testlang=/^int:(i2)/\1/o/{_field=int:abc} | ||
--regex-Testlang=/^int:(i3)/\1/o/{_field=int:} | ||
--regex-Testlang=/^int:(i4)/\1/o/ | ||
|
||
--regex-Testlang=/^bool:(b0)/\1/o/{_field=bool:abc} | ||
--regex-Testlang=/^bool:(b1)/\1/o/{_field=bool:} | ||
--regex-Testlang=/^bool:(b2)/\1/o/ | ||
|
||
--regex-Testlang=/^strbool:(sb0)/\1/o/{_field=strbool:abc} | ||
--regex-Testlang=/^strbool:(sb1)/\1/o/{_field=strbool:} | ||
--regex-Testlang=/^strbool:(sb2)/\1/o/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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