Skip to content

Commit

Permalink
Merge pull request #3731 from masatake/misc-fix
Browse files Browse the repository at this point in the history
Misc fix
  • Loading branch information
masatake committed May 21, 2023
2 parents dfabddc + 6077549 commit 8d5a92d
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 41 deletions.
48 changes: 24 additions & 24 deletions Tmain/errors-in-options-roles.d/stderr-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ status: 1
#
# --roles-C.h={system{local}
#
ctags: Warning: no such role: system{local of h kind in language C
ctags: Warning: no such role: "system{local" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=+{system{local}
#
ctags: Warning: no such role: system{local of h kind in language C
ctags: Warning: no such role: "system{local" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=-{system{local}
#
ctags: Warning: no such role: system{local of h kind in language C
ctags: Warning: no such role: "system{local" in kind 'h' in language "C"
status: 42

#
Expand Down Expand Up @@ -218,127 +218,127 @@ status: 1
#
# --roles-C.{header}={system{local}
#
ctags: Warning: no such role: system{local of h kind in language C
ctags: Warning: no such role: "system{local" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=+{system{local}
#
ctags: Warning: no such role: system{local of h kind in language C
ctags: Warning: no such role: "system{local" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=-{system{local}
#
ctags: Warning: no such role: system{local of h kind in language C
ctags: Warning: no such role: "system{local" in kind 'h' in language "C"
status: 42

#
# --roles-C.h={noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=+{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=-{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h={system}{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h={noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=+{system}{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=-{system}{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=+{system}-{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.h=-{system}+{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}={noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=+{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=-{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}={system}{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}={noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=+{system}{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=-{system}{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=+{system}-{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
# --roles-C.{header}=-{system}+{noSuchRole}
#
ctags: Warning: no such role: noSuchRole of h kind in language C
ctags: Warning: no such role: "noSuchRole" in kind 'h' in language "C"
status: 42

#
Expand Down
4 changes: 2 additions & 2 deletions main/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ extern bool isTagExtra (const tagEntryInfo *const tag);

/* Functions for attaching parser specific fields
*
* Which function you should use?
* ------------------------------
* Which function should I use?
* ----------------------------
* Case A:
*
* If your parser uses the Cork API, and your parser called
Expand Down
2 changes: 1 addition & 1 deletion main/lregex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ static void common_flag_role_long (const char* const s, const char* const v, voi
ptrn->u.tag.kindIndex, v);
if (!role)
{
error (WARNING, "no such role: %s in kind: %s of language: %s",
error (WARNING, "no such role: \"%s\" in kind: \"%s\" of language: \"%s\"",
v,
getLanguageKind(lang, ptrn->u.tag.kindIndex)->name,
getLanguageName (lang));
Expand Down
2 changes: 1 addition & 1 deletion main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3176,7 +3176,7 @@ static void processLangKindRoleDefinition (
char *rname = eStrndup (p, q - p);
roleDefinition *rdef = getLanguageRoleForName (language, kindIndex, rname);
if (!rdef)
error (WARNING, "no such role: %s of %c kind in language %s",
error (WARNING, "no such role: \"%s\" in kind \'%c\' in language \"%s\"",
rname, getLanguageKind (language, kindIndex)->letter,
getLanguageName (language));
else
Expand Down
36 changes: 25 additions & 11 deletions misc/ctags-optlib-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,19 @@

(defun ctags-optlib-mode-setup-function ()
(let ((st (syntax-table)))
(modify-syntax-entry ?\' " " st)
(modify-syntax-entry ?\" " " st)))
(modify-syntax-entry ?\' "." st)
(modify-syntax-entry ?\" "." st)))

(define-generic-mode ctags-optlib-mode
'(?#)
'(?# ?%)
nil
'(;;
;; Language
;;
("^--\\(langdef\\)=\\([a-zA-Z0-9]+\\)"
(1 font-lock-keyword-face t)
(2 font-lock-type-face t))
("^--\\(map\\)-\\([a-zA-Z0-9]+\\)=.*"
(1 font-lock-keyword-face t)
(2 font-lock-type-face t))
("--\\(alias\\)-\\([a-zA-Z0-9]+\\)=.*"
("^--\\(map\\|alias\\|_?prelude\\|_?scopesep\\)-\\([a-zA-Z0-9]+\\)=.*"
(1 font-lock-keyword-face t)
(2 font-lock-type-face t))
;;
Expand Down Expand Up @@ -99,12 +96,13 @@
;;
;; Roles
;;
("^--\\(_roledef\\)-\\([a-zA-Z0-9]+\\)=\\([a-zA-Z]\\)\\.\\([a-zA-Z0-9]+\\),\\(.*\\)$"
("^[ \t]*--\\(_roledef\\)-\\([a-zA-Z0-9]+\\)\\.\\(?:\\([a-zA-Z]\\)\\|{\\([a-zA-Z0-9]+\\)}\\)=\\([a-zA-Z0-9]+\\),\\(.*\\)$"
(1 font-lock-keyword-face t)
(2 font-lock-type-face t)
(3 font-lock-constant-face t)
(4 font-lock-constant-face t)
(5 font-lock-doc-face t))
(3 font-lock-constant-face t t)
(4 font-lock-constant-face t t)
(5 font-lock-variable-name-face t)
(6 font-lock-doc-face t))
;;
;; Extras
;;
Expand All @@ -118,6 +116,14 @@
(2 font-lock-type-face t)
(3 font-lock-variable-name-face t))
;;
;; Parameters
;;
("^--\\(_?paramdef\\)-\\([a-zA-Z0-9]+\\)=\\([a-zA-Z0-9]+\\),\\(.*\\)"
(1 font-lock-keyword-face t)
(2 font-lock-type-face t)
(3 font-lock-variable-name-face t)
(4 font-lock-doc-face t))
;;
;; Flags
;;
(".*{\\(tenter\\|tjump\\)=\\([a-zA-Z0-9_]+\\)}"
Expand Down Expand Up @@ -147,8 +153,16 @@
(2 font-lock-builtin-face t))
("{\\(icase\\|exclusive\\|tleave\\|placeholder\\|tquit\\|mgroup\\|dedicated\\|shared\\|_trace\\)[^}]*}"
(1 font-lock-keyword-face t))
("{\\(_anonymous=\\)[^}]*}"
(1 font-lock-keyword-face t))
("{\\(_guest=\\)\\([^,]+\\)?[^}]*}"
(1 font-lock-keyword-face t)
(2 font-lock-type-face t t))
("\\<[p]\\>" . font-lock-keyword-face)
("/\\([a-zA-Z]\\)/"
(1 font-lock-constant-face t))
("{{$\\|^}}" . font-lock-preprocessor-face)
;;
)
'("\\.ctags\\'")
'(ctags-optlib-mode-setup-function)
Expand Down
2 changes: 1 addition & 1 deletion misc/optlib2c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ EOF
########################################################################
my $langdef_flags =
[
[ qr/\{base=([^\{]+)\}/, sub {
[ qr/\{base=([^\}]+)\}/, sub {
$_[0]->{'base'} = $1;
} ],
[ qr/\{(dedicated|shared|bidirectional)\}/, sub {
Expand Down
2 changes: 1 addition & 1 deletion optlib/gperf.ctags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# lex.ctags --- multitable regex parser for gperf input
# gperf.ctags --- multitable regex parser for gperf input
#
# Copyright (c) 2022, Red Hat, Inc.
# Copyright (c) 2022, Masatake YAMATO
Expand Down

0 comments on commit 8d5a92d

Please sign in to comment.