diff --git a/Tmain/list-fields-with-prefix.d/stdout-expected.txt b/Tmain/list-fields-with-prefix.d/stdout-expected.txt index 798fe68062..6d1e01c1c8 100644 --- a/Tmain/list-fields-with-prefix.d/stdout-expected.txt +++ b/Tmain/list-fields-with-prefix.d/stdout-expected.txt @@ -48,6 +48,7 @@ x UCTAGSxpath no NONE s-- no -- xpath for - UCTAGSoverline no ReStructuredText --b no -- whether using overline & underline for declaring section - UCTAGSsectionMarker no ReStructuredText s-- no -- character used for declaring section - UCTAGSmixin yes Ruby s-- no -- how the class or module is mixed in (mixin:HOW:MODULE) +- UCTAGSmodule yes SCSS s-- no rw the name of module behind the namespace - UCTAGSparameter no SystemVerilog --b no -- parameter whose value can be overridden. - UCTAGStarget yes Thrift s-- no -- the target language specified at "namespace" - UCTAGSthrows yes Thrift s-- no -- throws list of function diff --git a/Tmain/list-fields.d/stdout-expected.txt b/Tmain/list-fields.d/stdout-expected.txt index 57b0503ab3..ed5696d7de 100644 --- a/Tmain/list-fields.d/stdout-expected.txt +++ b/Tmain/list-fields.d/stdout-expected.txt @@ -66,6 +66,7 @@ z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field outpu - overline no ReStructuredText --b no -- whether using overline & underline for declaring section - sectionMarker no ReStructuredText s-- no -- character used for declaring section - mixin yes Ruby s-- no -- how the class or module is mixed in (mixin:HOW:MODULE) +- module yes SCSS s-- no rw the name of module behind the namespace - parameter no SystemVerilog --b no -- parameter whose value can be overridden. - target yes Thrift s-- no -- the target language specified at "namespace" - throws yes Thrift s-- no -- throws list of function diff --git a/Units/parser-scss.r/use.d/expected.tags b/Units/parser-scss.r/use.d/expected.tags index 4c1167c5ea..67d61746c6 100644 --- a/Units/parser-scss.r/use.d/expected.tags +++ b/Units/parser-scss.r/use.d/expected.tags @@ -1,10 +1,10 @@ X/y input.scss /^@use "X\/y";$/;" M roles:used -y input.scss /^@use "X\/y";$/;" n roles:def +y input.scss /^@use "X\/y";$/;" n roles:def module:X/y Z input.scss /^@use "Z";$/;" M roles:used -Z input.scss /^@use "Z";$/;" n roles:def +Z input.scss /^@use "Z";$/;" n roles:def module:Z A input.scss /^@use "A" as NS;$/;" M roles:used -NS input.scss /^@use "A" as NS;$/;" n roles:def +NS input.scss /^@use "A" as NS;$/;" n roles:def module:A B/ input.scss /^@use "B\/";$/;" M roles:used C/d/e input.scss /^@use 'C\/d\/e';$/;" M roles:used -e input.scss /^@use 'C\/d\/e';$/;" n roles:def +e input.scss /^@use 'C\/d\/e';$/;" n roles:def module:C/d/e P/q input.scss /^@use 'P\/q' as *;$/;" M roles:used diff --git a/docs/man/ctags-lang-scss.7.rst b/docs/man/ctags-lang-scss.7.rst index a415409764..9eb0940823 100644 --- a/docs/man/ctags-lang-scss.7.rst +++ b/docs/man/ctags-lang-scss.7.rst @@ -28,6 +28,7 @@ Change since "0.0" * New kind ``module`` and new role ``used`` of the ``module`` kind * New kind ``namespace`` +* New field ``module`` SEE ALSO -------- diff --git a/man/ctags-lang-scss.7.rst.in b/man/ctags-lang-scss.7.rst.in index 7c446ef9b9..62232bd12f 100644 --- a/man/ctags-lang-scss.7.rst.in +++ b/man/ctags-lang-scss.7.rst.in @@ -28,6 +28,7 @@ Change since "0.0" * New kind ``module`` and new role ``used`` of the ``module`` kind * New kind ``namespace`` +* New field ``module`` SEE ALSO -------- diff --git a/optlib/scss.c b/optlib/scss.c index 113d3a79e8..ba10b589e5 100644 --- a/optlib/scss.c +++ b/optlib/scss.c @@ -63,18 +63,18 @@ static void initializeSCSSParser (const langType language) " % module-name offset' count namespace-string\n" " _copyinterval\n" " dup length 0 gt {\n" - " /namespace @1 _tag _commit pop\n" + " /namespace @1 _tag _commit \\1 SCSS.module:\n" " } {\n" " clear\n" " } ifelse\n" " } {\n" " % Extract the module name as a namespace.\n" - " \\1 /namespace @1 _tag _commit pop\n" + " \\1 /namespace @1 _tag _commit \\1 SCSS.module:\n" " } ifelse\n" " } {\n" " % \"as *\" doesn't make a namespace.\n" " \\3 (*) ne {\n" - " \\3 /namespace @3 _tag _commit pop\n" + " \\3 /namespace @3 _tag _commit \\1 SCSS.module:\n" " } if\n" " } ifelse\n" "}}", NULL); @@ -233,6 +233,16 @@ extern parserDefinition* SCSSParser (void) ATTACH_ROLES(SCSSModuleRoleTable), }, }; + static fieldDefinition SCSSFieldTable [] = { + { + .enabled = true, + .name = "module", + .description = "the name of module behind the namespace", + .dataType = FIELDTYPE_SCRIPTABLE|FIELDTYPE_STRING, + .getValueObject = getFieldValueGeneric, + .setValueObject = setFieldValueGeneric, + }, + }; parserDefinition* const def = parserNew ("SCSS"); @@ -246,6 +256,8 @@ extern parserDefinition* SCSSParser (void) def->useCork = CORK_QUEUE; def->kindTable = SCSSKindTable; def->kindCount = ARRAY_SIZE(SCSSKindTable); + def->fieldTable = SCSSFieldTable; + def->fieldCount = ARRAY_SIZE(SCSSFieldTable); def->initialize = initializeSCSSParser; return def; diff --git a/optlib/scss.ctags b/optlib/scss.ctags index 80bbd32314..c615ff8f3c 100644 --- a/optlib/scss.ctags +++ b/optlib/scss.ctags @@ -40,6 +40,9 @@ --kinddef-SCSS=M,module,modules --_roledef-SCSS.{module}=used,used +--_fielddef-SCSS=module,the name of module behind the namespace{datatype=str} +--fields-SCSS=+{module} + --_tabledef-SCSS=toplevel --_tabledef-SCSS=comment --_tabledef-SCSS=interp @@ -69,18 +72,18 @@ % module-name offset' count namespace-string _copyinterval dup length 0 gt { - /namespace @1 _tag _commit pop + /namespace @1 _tag _commit \1 SCSS.module: } { clear } ifelse } { % Extract the module name as a namespace. - \1 /namespace @1 _tag _commit pop + \1 /namespace @1 _tag _commit \1 SCSS.module: } ifelse } { % "as *" doesn't make a namespace. \3 (*) ne { - \3 /namespace @3 _tag _commit pop + \3 /namespace @3 _tag _commit \1 SCSS.module: } if } ifelse }}