[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

langmap for pygments-parser is case sensitive

Subject: langmap for pygments-parser is case sensitive
Date: Fri, 12 Dec 2014 11:59:48 +0900 (JST)


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

# 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>
  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 
    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 
    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

If this is the issue caused by pygments, this is just for
your information.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]