|
From: | Shigio YAMAGUCHI |
Subject: | Re: langmap for pygments-parser is case sensitive |
Date: | Sat, 13 Dec 2014 08:16:16 +0900 |
Hi,
> pygments.util.ClassNotFound: no lexer for alias 'awk' found
This is the right behavior because Pygments 1.4 does not have 'awk' lexer.
> It works fine if I change the rule name from "Awk" to "awk"(lower case) in gtags.conf.
In this case actually pygments plugin skips processing the file,
because lower case langname is reserved for gtags's built-in parser.
Thanks,
2014-12-12 11:59 GMT+09:00 KAICHO <address@hidden>:
> Hi,
>
> gtags could fail to analyze a file even if there is a
>
> rule for the file in gtags.conf, as langmap/gtags_parser
> configuration in gtags.conf is case sensitive.
>
> Followings are the simple example, a.awk file can not be
> analyzed by gtags even if "Awk" rule is in gtags.conf.
> It works fine if I change the rule name from "Awk" to
> "awk"(lower case) in gtags.conf.
>
> # ls -al
> total 20
> drwxr-xr-x. 2 root root 4096 12月 11 18:31 2014 .
> drwxr-xr-x. 111 root root 12288 12月 11 18:31 2014 ..
> -rw-r--r--. 1 root root 0 12月 11 18:30 2014 a.awk
> -rw-r--r--. 1 root root 99 12月 11 18:30 2014 gtags.conf
>
> # cat gtags.conf
> default:\
> :langmap=Awk\:.awk.gawk.mawk:\
> :gtags_parser=Awk\:/usr/lib64/gtags/pygments-parser.la:
>
> # gtags -v --gtagsconf=./gtags.conf
> [Thu Dec 11 18:31:48 JST 2014] Gtags started.
> Using plug-in parser.
> [Thu Dec 11 18:31:48 JST 2014] Creating 'GTAGS' and 'GRTAGS'.
> [1] extracting tags of a.awk
> path = ./a.awk, lang = Awk, decided by suffix(.awk)
> Traceback (most recent call last):
> File "/usr/share/gtags/script/pygments_parser.py", line 240, in <module>
> main()
> File "/usr/share/gtags/script/pygments_parser.py", line 237, in main
> handle_requests(langmap, parser_options)
> File "/usr/share/gtags/script/pygments_parser.py", line 210, in handle_requests
> tags = parser.parse(path)
> File "/usr/share/gtags/script/pygments_parser.py", line 175, in parse
> ref_result = self.ref_parser.parse(path)
> File "/usr/share/gtags/script/pygments_parser.py", line 104, in parse
> lexer = self.get_lexer_by_langmap(path)
> File "/usr/share/gtags/script/pygments_parser.py", line 119, in get_lexer_by_langmap
> lexer = pygments.lexers.get_lexer_by_name(name)
> File "/usr/lib/python2.6/site-packages/pygments/lexers/__init__.py", line 80, in get_lexer_by_name
> raise ClassNotFound('no lexer for alias %r found' % _alias)
> pygments.util.ClassNotFound: no lexer for alias 'awk' found
> gtags: unexpected EOF.
>
> I know this could be caused by pygments package issue.
> I use the package version 1.4 on CentOS 6(with python=2.6.6).
>
> # rpm -q python-pygments
> python-pygments-1.4-6.el6.noarch
> python-2.6.6-36.el6.x86_64
>
> If this is the issue caused by pygments, this is just for
> your information.
>
>
> Regards,
> kaicho
>
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-global
>
_______________________________________________
Bug-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-global
[Prev in Thread] | Current Thread | [Next in Thread] |