diff --git a/setup.py b/setup.py index 53020337a3f..69f5915dff7 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,8 @@ def read(*names, **kwargs): # typecode 'binaryornot >= 0.4.0', 'chardet >= 3.0.0, <4.0.0', - 'pygments >= 2.0.1, <2.1', + # note that we use a short version range because we use a simpler lexer list + 'pygments >= 2.2.0, <2.3', 'typecode-libmagic', # packagedcode diff --git a/src/typecode/bsd-simplified.LICENSE b/src/typecode/bsd-simplified.LICENSE new file mode 100644 index 00000000000..804725c7ae4 --- /dev/null +++ b/src/typecode/bsd-simplified.LICENSE @@ -0,0 +1,7 @@ +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/typecode/contenttype.py b/src/typecode/contenttype.py index ecfd9fb9e02..b3ba4daf441 100644 --- a/src/typecode/contenttype.py +++ b/src/typecode/contenttype.py @@ -31,9 +31,6 @@ import mimetypes as mimetype_python import logging -import pygments.lexers -import pygments.util - import binaryornot.check from pdfminer.pdfparser import PDFParser @@ -46,6 +43,10 @@ from commoncode import filetype from commoncode.system import on_linux +from typecode.pygments_lexers import ClassNotFound as LexerClassNotFound +from typecode.pygments_lexers import get_lexer_for_filename +from typecode.pygments_lexers import guess_lexer + from typecode import magic2 from typecode import entropy @@ -257,9 +258,9 @@ def filetype_pygment(self): """ if self._filetype_pygments is None: self._filetype_pygments = '' - if self.is_file: + if self.is_text and not self.is_media: lexer = get_pygments_lexer(self.location) - if lexer: + if lexer and not lexer.name.startswith('JSON'): self._filetype_pygments = lexer.name or '' else: self._filetype_pygments = '' @@ -549,7 +550,7 @@ def is_script(self): Return True if the file is script-like. """ ft = self.filetype_file.lower() - if self.is_text is True and ('text' in ft and 'script' in ft): + if self.is_text is True and 'script' in ft and not 'makefile' in ft: return True else: return False @@ -565,14 +566,7 @@ def is_source(self): if self.location.endswith(PLAIN_TEXT_EXTENSIONS): return False - ft = self.filetype_file.lower() - pt = self.filetype_pygment.lower() - - pom_ext = 'pom.xml' if on_linux else u'pom.xml' - - if 'xml' not in ft and \ - ('xml' not in pt or self.location.endswith(pom_ext)) and \ - (pt or self.is_script is True): + if self.filetype_pygment or self.is_script is True: return True else: return False @@ -583,7 +577,7 @@ def programming_language(self): Return the programming language if the file is source code or an empty string. """ - return self.is_source and self.filetype_pygment or '' + return self.filetype_pygment or '' @property def is_c_source(self): @@ -687,20 +681,18 @@ def get_pygments_lexer(location): # NOTE: we use only the location for its file name here, we could use # lowercase location may be - lexer = pygments.lexers.get_lexer_for_filename(location, - stripnl=False, - stripall=False) + lexer = get_lexer_for_filename(location, stripnl=False, stripall=False) return lexer - except pygments.util.ClassNotFound: + except LexerClassNotFound: try: # if Pygments does not guess we should not carry forward # read the first 4K of the file with open(location, 'rb') as f: content = f.read(4096) - guessed = pygments.lexers.guess_lexer(content) + guessed = guess_lexer(content) return guessed - except pygments.util.ClassNotFound: + except LexerClassNotFound: return @@ -709,23 +701,7 @@ def get_filetype(location): LEGACY: Return the best filetype for location using multiple tools. """ T = get_type(location) - filetype = T.filetype_file.lower() - filetype_pygment = T.filetype_pygment - # 'file' is not good at detecting language, if pygment even can't - # detect it, we can ignore it - if T.is_text and T.filetype_pygment: - # Pygment tends to recognize many XML files are Genshi files - # Genshi is rare and irrelevant, just declare as XML - ftpl = filetype_pygment.lower() - if 'genshi' in ftpl or 'xml+evoque' in ftpl: - return 'xml language text' - - # pygment recognizes elfs as Groff files - if not ('roff' in filetype_pygment and 'roff' not in filetype): - if filetype_pygment.lower() != 'text only': - # FIXME: this 'language text' is ugly - return filetype_pygment.lower() + ' language text' - return filetype + return T.filetype_file.lower() STD_INCLUDES = ('/usr/lib/gcc', '/usr/lib', '/usr/include', diff --git a/src/typecode/prog_lexers.ABOUT b/src/typecode/prog_lexers.ABOUT new file mode 100644 index 00000000000..45b710948c2 --- /dev/null +++ b/src/typecode/prog_lexers.ABOUT @@ -0,0 +1,21 @@ +about_resource: prog_lexers.py +attribute: true +copyright: Copyright by the Pygments team +download_url: https://pypi.python.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl#md5=ce67fc58b51ffd29a2de8b97fcda274a +homepage_url: http://pygments.org/ +license_expression: bsd-simplified +licenses: +- file: bsd-simplified.LICENSE + key: bsd-simplified + name: BSD-2-Clause +name: Pygments +notice_file: pygments.NOTICE +notice_url: https://bitbucket.org/birkenfeld/pygments-main/src/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/LICENSE?at=default&fileviewer=file-view-default +owner: Pocoo Team +owner_url: http://www.pocoo.org/ +track_changes: true +vcs_repository: http://bitbucket.org/birkenfeld/pygments-main +version: 2.2.0 + +vcs_tool: hg +notes: this is a tiny subset of Pygments to focus on programming languages detection only. \ No newline at end of file diff --git a/src/typecode/prog_lexers.py b/src/typecode/prog_lexers.py new file mode 100644 index 00000000000..35aed95a3d9 --- /dev/null +++ b/src/typecode/prog_lexers.py @@ -0,0 +1,395 @@ +# -*- coding: utf-8 -*- +""" +This file is a list of the subset of lexers we care for as actual programming +languages from the larger whole generated list at pygments.lexers._mapping + +This is based on Pygments 2.2.0 pygments.lexers._mapping and the modification is +to comment out certain/most lexers. + +Copyright (c) 2006-2017 by the respective authors (see AUTHORS file). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" + +from __future__ import print_function + + +LEXERS = { + 'ABAPLexer': ('pygments.lexers.business', 'ABAP', ('abap',), ('*.abap',), ('text/x-abap',)), + # 'APLLexer': ('pygments.lexers.apl', 'APL', ('apl',), ('*.apl',), ()), + 'ActionScript3Lexer': ('pygments.lexers.actionscript', 'ActionScript 3', ('as3', 'actionscript3'), ('*.as',), ('application/x-actionscript3', 'text/x-actionscript3', 'text/actionscript3')), + 'ActionScriptLexer': ('pygments.lexers.actionscript', 'ActionScript', ('as', 'actionscript'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')), + #'AdaLexer': ('pygments.lexers.pascal', 'Ada', ('ada', 'ada95', 'ada2005'), ('*.adb', '*.ads', '*.ada'), ('text/x-ada',)), + #'AgdaLexer': ('pygments.lexers.haskell', 'Agda', ('agda',), ('*.agda',), ('text/x-agda',)), + #'AlloyLexer': ('pygments.lexers.dsls', 'Alloy', ('alloy',), ('*.als',), ('text/x-alloy',)), + #'AmbientTalkLexer': ('pygments.lexers.ambient', 'AmbientTalk', ('at', 'ambienttalk', 'ambienttalk/2'), ('*.at',), ('text/x-ambienttalk',)), + #'AntlrActionScriptLexer': ('pygments.lexers.parsers', 'ANTLR With ActionScript Target', ('antlr-as', 'antlr-actionscript'), ('*.G', '*.g'), ()), + #'AntlrCSharpLexer': ('pygments.lexers.parsers', 'ANTLR With C# Target', ('antlr-csharp', 'antlr-c#'), ('*.G', '*.g'), ()), + #'AntlrCppLexer': ('pygments.lexers.parsers', 'ANTLR With CPP Target', ('antlr-cpp',), ('*.G', '*.g'), ()), + #'AntlrJavaLexer': ('pygments.lexers.parsers', 'ANTLR With Java Target', ('antlr-java',), ('*.G', '*.g'), ()), + 'AntlrLexer': ('pygments.lexers.parsers', 'ANTLR', ('antlr',), ('*.G', '*.g'), ()), + #'AntlrObjectiveCLexer': ('pygments.lexers.parsers', 'ANTLR With ObjectiveC Target', ('antlr-objc',), ('*.G', '*.g'), ()), + #'AntlrPerlLexer': ('pygments.lexers.parsers', 'ANTLR With Perl Target', ('antlr-perl',), ('*.G', '*.g'), ()), + #'AntlrPythonLexer': ('pygments.lexers.parsers', 'ANTLR With Python Target', ('antlr-python',), ('*.G', '*.g'), ()), + #'AntlrRubyLexer': ('pygments.lexers.parsers', 'ANTLR With Ruby Target', ('antlr-ruby', 'antlr-rb'), ('*.G', '*.g'), ()), + #'ApacheConfLexer': ('pygments.lexers.configs', 'ApacheConf', ('apacheconf', 'aconf', 'apache'), ('.htaccess', 'apache.conf', 'apache2.conf'), ('text/x-apacheconf',)), + 'AppleScriptLexer': ('pygments.lexers.scripting', 'AppleScript', ('applescript',), ('*.applescript',), ()), + 'AspectJLexer': ('pygments.lexers.jvm', 'AspectJ', ('aspectj',), ('*.aj',), ('text/x-aspectj',)), + #'AsymptoteLexer': ('pygments.lexers.graphics', 'Asymptote', ('asy', 'asymptote'), ('*.asy',), ('text/x-asymptote',)), + #'AutoItLexer': ('pygments.lexers.automation', 'AutoIt', ('autoit',), ('*.au3',), ('text/x-autoit',)), + #'AutohotkeyLexer': ('pygments.lexers.automation', 'autohotkey', ('ahk', 'autohotkey'), ('*.ahk', '*.ahkl'), ('text/x-autohotkey',)), + #'AwkLexer': ('pygments.lexers.textedit', 'Awk', ('awk', 'gawk', 'mawk', 'nawk'), ('*.awk',), ('application/x-awk',)), + #'BBCodeLexer': ('pygments.lexers.markup', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)), + 'BaseMakefileLexer': ('pygments.lexers.make', 'Base Makefile', ('basemake',), (), ()), + 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript')), + #'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console',), ('*.sh-session',), ('application/x-shell-session',)), + 'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat', 'batch', 'dosbatch', 'winbatch'), ('*.bat', '*.cmd'), ('application/x-dos-batch',)), + #'BefungeLexer': ('pygments.lexers.esoteric', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)), + #'BlitzBasicLexer': ('pygments.lexers.basic', 'BlitzBasic', ('blitzbasic', 'b3d', 'bplus'), ('*.bb', '*.decls'), ('text/x-bb',)), + #'BlitzMaxLexer': ('pygments.lexers.basic', 'BlitzMax', ('blitzmax', 'bmax'), ('*.bmx',), ('text/x-bmx',)), + #'BooLexer': ('pygments.lexers.dotnet', 'Boo', ('boo',), ('*.boo',), ('text/x-boo',)), + #'BrainfuckLexer': ('pygments.lexers.esoteric', 'Brainfuck', ('brainfuck', 'bf'), ('*.bf', '*.b'), ('application/x-brainfuck',)), + #'BroLexer': ('pygments.lexers.dsls', 'Bro', ('bro',), ('*.bro',), ()), + #'BugsLexer': ('pygments.lexers.modeling', 'BUGS', ('bugs', 'winbugs', 'openbugs'), ('*.bug',), ()), + 'CLexer': ('pygments.lexers.c_cpp', 'C', ('c',), ('*.c', '*.h', '*.idc'), ('text/x-chdr', 'text/x-csrc')), + 'CMakeLexer': ('pygments.lexers.make', 'CMake', ('cmake',), ('*.cmake', 'CMakeLists.txt'), ('text/x-cmake',)), + #'CObjdumpLexer': ('pygments.lexers.asm', 'c-objdump', ('c-objdump',), ('*.c-objdump',), ('text/x-c-objdump',)), + 'CSharpAspxLexer': ('pygments.lexers.dotnet', 'aspx-cs', ('aspx-cs',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()), + 'CSharpLexer': ('pygments.lexers.dotnet', 'C#', ('csharp', 'c#'), ('*.cs',), ('text/x-csharp',)), + #'Ca65Lexer': ('pygments.lexers.asm', 'ca65 assembler', ('ca65',), ('*.s',), ()), + #'CbmBasicV2Lexer': ('pygments.lexers.basic', 'CBM BASIC V2', ('cbmbas',), ('*.bas',), ()), + #'CeylonLexer': ('pygments.lexers.jvm', 'Ceylon', ('ceylon',), ('*.ceylon',), ('text/x-ceylon',)), + #'Cfengine3Lexer': ('pygments.lexers.configs', 'CFEngine3', ('cfengine3', 'cf3'), ('*.cf',), ()), + #'ChaiscriptLexer': ('pygments.lexers.scripting', 'ChaiScript', ('chai', 'chaiscript'), ('*.chai',), ('text/x-chaiscript', 'application/x-chaiscript')), + #'ChapelLexer': ('pygments.lexers.chapel', 'Chapel', ('chapel', 'chpl'), ('*.chpl',), ()), + #'CheetahHtmlLexer': ('pygments.lexers.templates', 'HTML+Cheetah', ('html+cheetah', 'html+spitfire', 'htmlcheetah'), (), ('text/html+cheetah', 'text/html+spitfire')), + #'CheetahJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Cheetah', ('js+cheetah', 'javascript+cheetah', 'js+spitfire', 'javascript+spitfire'), (), ('application/x-javascript+cheetah', 'text/x-javascript+cheetah', 'text/javascript+cheetah', 'application/x-javascript+spitfire', 'text/x-javascript+spitfire', 'text/javascript+spitfire')), + #'CheetahLexer': ('pygments.lexers.templates', 'Cheetah', ('cheetah', 'spitfire'), ('*.tmpl', '*.spt'), ('application/x-cheetah', 'application/x-spitfire')), + #'CheetahXmlLexer': ('pygments.lexers.templates', 'XML+Cheetah', ('xml+cheetah', 'xml+spitfire'), (), ('application/xml+cheetah', 'application/xml+spitfire')), + #'CirruLexer': ('pygments.lexers.webmisc', 'Cirru', ('cirru',), ('*.cirru', '*.cr'), ('text/x-cirru',)), + #'ClayLexer': ('pygments.lexers.c_like', 'Clay', ('clay',), ('*.clay',), ('text/x-clay',)), + 'ClojureLexer': ('pygments.lexers.jvm', 'Clojure', ('clojure', 'clj'), ('*.clj',), ('text/x-clojure', 'application/x-clojure')), + 'ClojureScriptLexer': ('pygments.lexers.jvm', 'ClojureScript', ('clojurescript', 'cljs'), ('*.cljs',), ('text/x-clojurescript', 'application/x-clojurescript')), + 'CobolFreeformatLexer': ('pygments.lexers.business', 'COBOLFree', ('cobolfree',), ('*.cbl', '*.CBL'), ()), + 'CobolLexer': ('pygments.lexers.business', 'COBOL', ('cobol',), ('*.cob', '*.COB', '*.cpy', '*.CPY'), ('text/x-cobol',)), + 'CoffeeScriptLexer': ('pygments.lexers.javascript', 'CoffeeScript', ('coffee-script', 'coffeescript', 'coffee'), ('*.coffee',), ('text/coffeescript',)), + #'ColdfusionCFCLexer': ('pygments.lexers.templates', 'Coldfusion CFC', ('cfc',), ('*.cfc',), ()), + #'ColdfusionHtmlLexer': ('pygments.lexers.templates', 'Coldfusion HTML', ('cfm',), ('*.cfm', '*.cfml'), ('application/x-coldfusion',)), + #'ColdfusionLexer': ('pygments.lexers.templates', 'cfstatement', ('cfs',), (), ()), + 'CommonLispLexer': ('pygments.lexers.lisp', 'Common Lisp', ('common-lisp', 'cl', 'lisp', 'elisp', 'emacs', 'emacs-lisp'), ('*.cl', '*.lisp', '*.el'), ('text/x-common-lisp',)), + #'CoqLexer': ('pygments.lexers.theorem', 'Coq', ('coq',), ('*.v',), ('text/x-coq',)), + 'CppLexer': ('pygments.lexers.c_cpp', 'C++', ('cpp', 'c++'), ('*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx', '*.C', '*.H', '*.cp', '*.CPP'), ('text/x-c++hdr', 'text/x-c++src')), + #'CppObjdumpLexer': ('pygments.lexers.asm', 'cpp-objdump', ('cpp-objdump', 'c++-objdumb', 'cxx-objdump'), ('*.cpp-objdump', '*.c++-objdump', '*.cxx-objdump'), ('text/x-cpp-objdump',)), + #'CrocLexer': ('pygments.lexers.d', 'Croc', ('croc',), ('*.croc',), ('text/x-crocsrc',)), + #'CryptolLexer': ('pygments.lexers.haskell', 'Cryptol', ('cryptol', 'cry'), ('*.cry',), ('text/x-cryptol',)), + #'CssDjangoLexer': ('pygments.lexers.templates', 'CSS+Django/Jinja', ('css+django', 'css+jinja'), (), ('text/css+django', 'text/css+jinja')), + #'CssErbLexer': ('pygments.lexers.templates', 'CSS+Ruby', ('css+erb', 'css+ruby'), (), ('text/css+ruby',)), + #'CssGenshiLexer': ('pygments.lexers.templates', 'CSS+Genshi Text', ('css+genshitext', 'css+genshi'), (), ('text/css+genshi',)), + 'CssLexer': ('pygments.lexers.css', 'CSS', ('css',), ('*.css',), ('text/css',)), + #'CssPhpLexer': ('pygments.lexers.templates', 'CSS+PHP', ('css+php',), (), ('text/css+php',)), + #'CssSmartyLexer': ('pygments.lexers.templates', 'CSS+Smarty', ('css+smarty',), (), ('text/css+smarty',)), + #'CudaLexer': ('pygments.lexers.c_like', 'CUDA', ('cuda', 'cu'), ('*.cu', '*.cuh'), ('text/x-cuda',)), + #'CypherLexer': ('pygments.lexers.graph', 'Cypher', ('cypher',), ('*.cyp', '*.cypher'), ()), + 'CythonLexer': ('pygments.lexers.python', 'Cython', ('cython', 'pyx', 'pyrex'), ('*.pyx', '*.pxd', '*.pxi'), ('text/x-cython', 'application/x-cython')), + #'DLexer': ('pygments.lexers.d', 'D', ('d',), ('*.d', '*.di'), ('text/x-dsrc',)), + #'DObjdumpLexer': ('pygments.lexers.asm', 'd-objdump', ('d-objdump',), ('*.d-objdump',), ('text/x-d-objdump',)), + #'DarcsPatchLexer': ('pygments.lexers.diff', 'Darcs Patch', ('dpatch',), ('*.dpatch', '*.darcspatch'), ()), + 'DartLexer': ('pygments.lexers.javascript', 'Dart', ('dart',), ('*.dart',), ('text/x-dart',)), + #'DebianControlLexer': ('pygments.lexers.installers', 'Debian Control file', ('control', 'debcontrol'), ('control',), ()), + 'DelphiLexer': ('pygments.lexers.pascal', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas',), ('text/x-pascal',)), + #'DgLexer': ('pygments.lexers.python', 'dg', ('dg',), ('*.dg',), ('text/x-dg',)), + #'DiffLexer': ('pygments.lexers.diff', 'Diff', ('diff', 'udiff'), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')), + #'DjangoLexer': ('pygments.lexers.templates', 'Django/Jinja', ('django', 'jinja'), (), ('application/x-django-templating', 'application/x-jinja')), + #'DockerLexer': ('pygments.lexers.configs', 'Docker', ('docker', 'dockerfile'), ('Dockerfile', '*.docker'), ('text/x-dockerfile-config',)), + #'DtdLexer': ('pygments.lexers.html', 'DTD', ('dtd',), ('*.dtd',), ('application/xml-dtd',)), + #'DuelLexer': ('pygments.lexers.webmisc', 'Duel', ('duel', 'jbst', 'jsonml+bst'), ('*.duel', '*.jbst'), ('text/x-duel', 'text/x-jbst')), + #'DylanConsoleLexer': ('pygments.lexers.dylan', 'Dylan session', ('dylan-console', 'dylan-repl'), ('*.dylan-console',), ('text/x-dylan-console',)), + #'DylanLexer': ('pygments.lexers.dylan', 'Dylan', ('dylan',), ('*.dylan', '*.dyl', '*.intr'), ('text/x-dylan',)), + #'DylanLidLexer': ('pygments.lexers.dylan', 'DylanLID', ('dylan-lid', 'lid'), ('*.lid', '*.hdp'), ('text/x-dylan-lid',)), + #'ECLLexer': ('pygments.lexers.ecl', 'ECL', ('ecl',), ('*.ecl',), ('application/x-ecl',)), + #'ECLexer': ('pygments.lexers.c_like', 'eC', ('ec',), ('*.ec', '*.eh'), ('text/x-echdr', 'text/x-ecsrc')), + #'EbnfLexer': ('pygments.lexers.parsers', 'EBNF', ('ebnf',), ('*.ebnf',), ('text/x-ebnf',)), + #'EiffelLexer': ('pygments.lexers.eiffel', 'Eiffel', ('eiffel',), ('*.e',), ('text/x-eiffel',)), + #'ElixirConsoleLexer': ('pygments.lexers.erlang', 'Elixir iex session', ('iex',), (), ('text/x-elixir-shellsession',)), + 'ElixirLexer': ('pygments.lexers.erlang', 'Elixir', ('elixir', 'ex', 'exs'), ('*.ex', '*.exs'), ('text/x-elixir',)), + 'ErbLexer': ('pygments.lexers.templates', 'ERB', ('erb',), (), ('application/x-ruby-templating',)), + 'ErlangLexer': ('pygments.lexers.erlang', 'Erlang', ('erlang',), ('*.erl', '*.hrl', '*.es', '*.escript'), ('text/x-erlang',)), + #'ErlangShellLexer': ('pygments.lexers.erlang', 'Erlang erl session', ('erl',), ('*.erl-sh',), ('text/x-erl-shellsession',)), + #'EvoqueHtmlLexer': ('pygments.lexers.templates', 'HTML+Evoque', ('html+evoque',), ('*.html',), ('text/html+evoque',)), + #'EvoqueLexer': ('pygments.lexers.templates', 'Evoque', ('evoque',), ('*.evoque',), ('application/x-evoque',)), + #'EvoqueXmlLexer': ('pygments.lexers.templates', 'XML+Evoque', ('xml+evoque',), ('*.xml',), ('application/xml+evoque',)), + 'FSharpLexer': ('pygments.lexers.dotnet', 'FSharp', ('fsharp',), ('*.fs', '*.fsi'), ('text/x-fsharp',)), + #'FactorLexer': ('pygments.lexers.factor', 'Factor', ('factor',), ('*.factor',), ('text/x-factor',)), + #'FancyLexer': ('pygments.lexers.ruby', 'Fancy', ('fancy', 'fy'), ('*.fy', '*.fancypack'), ('text/x-fancysrc',)), + #'FantomLexer': ('pygments.lexers.fantom', 'Fantom', ('fan',), ('*.fan',), ('application/x-fantom',)), + #'FelixLexer': ('pygments.lexers.felix', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)), + 'FortranLexer': ('pygments.lexers.fortran', 'Fortran', ('fortran',), ('*.f', '*.f90', '*.F', '*.F90'), ('text/x-fortran',)), + #'FoxProLexer': ('pygments.lexers.foxpro', 'FoxPro', ('foxpro', 'vfp', 'clipper', 'xbase'), ('*.PRG', '*.prg'), ()), + #'GAPLexer': ('pygments.lexers.algebra', 'GAP', ('gap',), ('*.g', '*.gd', '*.gi', '*.gap'), ()), + #'GLShaderLexer': ('pygments.lexers.graphics', 'GLSL', ('glsl',), ('*.vert', '*.frag', '*.geo'), ('text/x-glslsrc',)), + 'GasLexer': ('pygments.lexers.asm', 'GAS', ('gas', 'asm'), ('*.s', '*.S'), ('text/x-gas',)), + #'GenshiLexer': ('pygments.lexers.templates', 'Genshi', ('genshi', 'kid', 'xml+genshi', 'xml+kid'), ('*.kid',), ('application/x-genshi', 'application/x-kid')), + #'GenshiTextLexer': ('pygments.lexers.templates', 'Genshi Text', ('genshitext',), (), ('application/x-genshi-text', 'text/x-genshi')), + #'GettextLexer': ('pygments.lexers.textfmts', 'Gettext Catalog', ('pot', 'po'), ('*.pot', '*.po'), ('application/x-gettext', 'text/x-gettext', 'text/gettext')), + #'GherkinLexer': ('pygments.lexers.testing', 'Gherkin', ('cucumber', 'gherkin'), ('*.feature',), ('text/x-gherkin',)), + #'GnuplotLexer': ('pygments.lexers.graphics', 'Gnuplot', ('gnuplot',), ('*.plot', '*.plt'), ('text/x-gnuplot',)), + 'GoLexer': ('pygments.lexers.go', 'Go', ('go',), ('*.go',), ('text/x-gosrc',)), + #'GoloLexer': ('pygments.lexers.jvm', 'Golo', ('golo',), ('*.golo',), ()), + #'GoodDataCLLexer': ('pygments.lexers.business', 'GoodData-CL', ('gooddata-cl',), ('*.gdc',), ('text/x-gooddata-cl',)), + #'GosuLexer': ('pygments.lexers.jvm', 'Gosu', ('gosu',), ('*.gs', '*.gsx', '*.gsp', '*.vark'), ('text/x-gosu',)), + #'GosuTemplateLexer': ('pygments.lexers.jvm', 'Gosu Template', ('gst',), ('*.gst',), ('text/x-gosu-template',)), + #'GroffLexer': ('pygments.lexers.markup', 'Groff', ('groff', 'nroff', 'man'), ('*.[1234567]', '*.man'), ('application/x-troff', 'text/troff')), + 'GroovyLexer': ('pygments.lexers.jvm', 'Groovy', ('groovy',), ('*.groovy',), ('text/x-groovy',)), + #'HamlLexer': ('pygments.lexers.html', 'Haml', ('haml',), ('*.haml',), ('text/x-haml',)), + #'HandlebarsHtmlLexer': ('pygments.lexers.templates', 'HTML+Handlebars', ('html+handlebars',), ('*.handlebars', '*.hbs'), ('text/html+handlebars', 'text/x-handlebars-template')), + #'HandlebarsLexer': ('pygments.lexers.templates', 'Handlebars', ('handlebars',), (), ()), + 'HaskellLexer': ('pygments.lexers.haskell', 'Haskell', ('haskell', 'hs'), ('*.hs',), ('text/x-haskell',)), + 'HaxeLexer': ('pygments.lexers.haxe', 'Haxe', ('hx', 'haxe', 'hxsl'), ('*.hx', '*.hxsl'), ('text/haxe', 'text/x-haxe', 'text/x-hx')), + #'HtmlDjangoLexer': ('pygments.lexers.templates', 'HTML+Django/Jinja', ('html+django', 'html+jinja', 'htmldjango'), (), ('text/html+django', 'text/html+jinja')), + #'HtmlGenshiLexer': ('pygments.lexers.templates', 'HTML+Genshi', ('html+genshi', 'html+kid'), (), ('text/html+genshi',)), + 'HtmlLexer': ('pygments.lexers.html', 'HTML', ('html',), ('*.html', '*.htm', '*.xhtml',), ('text/html', 'application/xhtml+xml')), + #'HtmlPhpLexer': ('pygments.lexers.templates', 'HTML+PHP', ('html+php',), ('*.phtml',), ('application/x-php', 'application/x-httpd-php', 'application/x-httpd-php3', 'application/x-httpd-php4', 'application/x-httpd-php5')), + #'HtmlSmartyLexer': ('pygments.lexers.templates', 'HTML+Smarty', ('html+smarty',), (), ('text/html+smarty',)), + #'HttpLexer': ('pygments.lexers.textfmts', 'HTTP', ('http',), (), ()), + #'HxmlLexer': ('pygments.lexers.haxe', 'Hxml', ('haxeml', 'hxml'), ('*.hxml',), ()), + #'HyLexer': ('pygments.lexers.lisp', 'Hy', ('hylang',), ('*.hy',), ('text/x-hy', 'application/x-hy')), + #'HybrisLexer': ('pygments.lexers.scripting', 'Hybris', ('hybris', 'hy'), ('*.hy', '*.hyb'), ('text/x-hybris', 'application/x-hybris')), + #'IDLLexer': ('pygments.lexers.idl', 'IDL', ('idl',), ('*.pro',), ('text/idl',)), + #'IdrisLexer': ('pygments.lexers.haskell', 'Idris', ('idris', 'idr'), ('*.idr',), ('text/x-idris',)), + #'IgorLexer': ('pygments.lexers.igor', 'Igor', ('igor', 'igorpro'), ('*.ipf',), ('text/ipf',)), + #'Inform6Lexer': ('pygments.lexers.int_fiction', 'Inform 6', ('inform6', 'i6'), ('*.inf',), ()), + #'Inform6TemplateLexer': ('pygments.lexers.int_fiction', 'Inform 6 template', ('i6t',), ('*.i6t',), ()), + #'Inform7Lexer': ('pygments.lexers.int_fiction', 'Inform 7', ('inform7', 'i7'), ('*.ni', '*.i7x'), ()), + #'IniLexer': ('pygments.lexers.configs', 'INI', ('ini', 'cfg', 'dosini'), ('*.ini', '*.cfg'), ('text/x-ini',)), + #'IoLexer': ('pygments.lexers.iolang', 'Io', ('io',), ('*.io',), ('text/x-iosrc',)), + #'IokeLexer': ('pygments.lexers.jvm', 'Ioke', ('ioke', 'ik'), ('*.ik',), ('text/x-iokesrc',)), + #'IrcLogsLexer': ('pygments.lexers.textfmts', 'IRC logs', ('irc',), ('*.weechatlog',), ('text/x-irclog',)), + #'IsabelleLexer': ('pygments.lexers.theorem', 'Isabelle', ('isabelle',), ('*.thy',), ('text/x-isabelle',)), + #'JadeLexer': ('pygments.lexers.html', 'Jade', ('jade',), ('*.jade',), ('text/x-jade',)), + #'JagsLexer': ('pygments.lexers.modeling', 'JAGS', ('jags',), ('*.jag', '*.bug'), ()), + #'JasminLexer': ('pygments.lexers.jvm', 'Jasmin', ('jasmin', 'jasminxt'), ('*.j',), ()), + 'JavaLexer': ('pygments.lexers.jvm', 'Java', ('java',), ('*.java', ), ('text/x-java',)), + #'JavascriptDjangoLexer': ('pygments.lexers.templates', 'JavaScript+Django/Jinja', ('js+django', 'javascript+django', 'js+jinja', 'javascript+jinja'), (), ('application/x-javascript+django', 'application/x-javascript+jinja', 'text/x-javascript+django', 'text/x-javascript+jinja', 'text/javascript+django', 'text/javascript+jinja')), + #'JavascriptErbLexer': ('pygments.lexers.templates', 'JavaScript+Ruby', ('js+erb', 'javascript+erb', 'js+ruby', 'javascript+ruby'), (), ('application/x-javascript+ruby', 'text/x-javascript+ruby', 'text/javascript+ruby')), + #'JavascriptGenshiLexer': ('pygments.lexers.templates', 'JavaScript+Genshi Text', ('js+genshitext', 'js+genshi', 'javascript+genshitext', 'javascript+genshi'), (), ('application/x-javascript+genshi', 'text/x-javascript+genshi', 'text/javascript+genshi')), + 'JavascriptLexer': ('pygments.lexers.javascript', 'JavaScript', ('js', 'javascript'), ('*.js',), ('application/javascript', 'application/x-javascript', 'text/x-javascript', 'text/javascript')), + #'JavascriptPhpLexer': ('pygments.lexers.templates', 'JavaScript+PHP', ('js+php', 'javascript+php'), (), ('application/x-javascript+php', 'text/x-javascript+php', 'text/javascript+php')), + #'JavascriptSmartyLexer': ('pygments.lexers.templates', 'JavaScript+Smarty', ('js+smarty', 'javascript+smarty'), (), ('application/x-javascript+smarty', 'text/x-javascript+smarty', 'text/javascript+smarty')), + 'JsonLdLexer': ('pygments.lexers.data', 'JSON-LD', ('jsonld', 'json-ld'), ('*.jsonld',), ('application/ld+json',)), + 'JsonLexer': ('pygments.lexers.data', 'JSON', ('json',), ('*.json',), ('application/json',)), + #'JspLexer': ('pygments.lexers.templates', 'Java Server Page', ('jsp',), ('*.jsp',), ('application/x-jsp',)), + #'JuliaConsoleLexer': ('pygments.lexers.julia', 'Julia console', ('jlcon',), (), ()), + #'JuliaLexer': ('pygments.lexers.julia', 'Julia', ('julia', 'jl'), ('*.jl',), ('text/x-julia', 'application/x-julia')), + #'KalLexer': ('pygments.lexers.javascript', 'Kal', ('kal',), ('*.kal',), ('text/kal', 'application/kal')), + #'KconfigLexer': ('pygments.lexers.configs', 'Kconfig', ('kconfig', 'menuconfig', 'linux-config', 'kernel-config'), ('Kconfig', '*Config.in*', 'external.in*', 'standard-modules.in'), ('text/x-kconfig',)), + #'KokaLexer': ('pygments.lexers.haskell', 'Koka', ('koka',), ('*.kk', '*.kki'), ('text/x-koka',)), + 'KotlinLexer': ('pygments.lexers.jvm', 'Kotlin', ('kotlin',), ('*.kt',), ('text/x-kotlin',)), + #'LSLLexer': ('pygments.lexers.scripting', 'LSL', ('lsl',), ('*.lsl',), ('text/x-lsl',)), + #'LassoCssLexer': ('pygments.lexers.templates', 'CSS+Lasso', ('css+lasso',), (), ('text/css+lasso',)), + #'LassoHtmlLexer': ('pygments.lexers.templates', 'HTML+Lasso', ('html+lasso',), (), ('text/html+lasso', 'application/x-httpd-lasso', 'application/x-httpd-lasso[89]')), + #'LassoJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Lasso', ('js+lasso', 'javascript+lasso'), (), ('application/x-javascript+lasso', 'text/x-javascript+lasso', 'text/javascript+lasso')), + #'LassoLexer': ('pygments.lexers.javascript', 'Lasso', ('lasso', 'lassoscript'), ('*.lasso', '*.lasso[89]'), ('text/x-lasso',)), + #'LassoXmlLexer': ('pygments.lexers.templates', 'XML+Lasso', ('xml+lasso',), (), ('application/xml+lasso',)), + #'LeanLexer': ('pygments.lexers.theorem', 'Lean', ('lean',), ('*.lean',), ('text/x-lean',)), + #'LighttpdConfLexer': ('pygments.lexers.configs', 'Lighttpd configuration file', ('lighty', 'lighttpd'), (), ('text/x-lighttpd-conf',)), + #'LimboLexer': ('pygments.lexers.inferno', 'Limbo', ('limbo',), ('*.b',), ('text/limbo',)), + #'LiquidLexer': ('pygments.lexers.templates', 'liquid', ('liquid',), ('*.liquid',), ()), + #'LiterateAgdaLexer': ('pygments.lexers.haskell', 'Literate Agda', ('lagda', 'literate-agda'), ('*.lagda',), ('text/x-literate-agda',)), + #'LiterateCryptolLexer': ('pygments.lexers.haskell', 'Literate Cryptol', ('lcry', 'literate-cryptol', 'lcryptol'), ('*.lcry',), ('text/x-literate-cryptol',)), + #'LiterateHaskellLexer': ('pygments.lexers.haskell', 'Literate Haskell', ('lhs', 'literate-haskell', 'lhaskell'), ('*.lhs',), ('text/x-literate-haskell',)), + #'LiterateIdrisLexer': ('pygments.lexers.haskell', 'Literate Idris', ('lidr', 'literate-idris', 'lidris'), ('*.lidr',), ('text/x-literate-idris',)), + #'LiveScriptLexer': ('pygments.lexers.javascript', 'LiveScript', ('live-script', 'livescript'), ('*.ls',), ('text/livescript',)), + #'LlvmLexer': ('pygments.lexers.asm', 'LLVM', ('llvm',), ('*.ll',), ('text/x-llvm',)), + #'LogosLexer': ('pygments.lexers.objective', 'Logos', ('logos',), ('*.x', '*.xi', '*.xm', '*.xmi'), ('text/x-logos',)), + #'LogtalkLexer': ('pygments.lexers.prolog', 'Logtalk', ('logtalk',), ('*.lgt', '*.logtalk'), ('text/x-logtalk',)), + 'LuaLexer': ('pygments.lexers.scripting', 'Lua', ('lua',), ('*.lua', '*.wlua'), ('text/x-lua', 'application/x-lua')), + #'MOOCodeLexer': ('pygments.lexers.scripting', 'MOOCode', ('moocode', 'moo'), ('*.moo',), ('text/x-moocode',)), + #'MakefileLexer': ('pygments.lexers.make', 'Makefile', ('make', 'makefile', 'mf', 'bsdmake'), ('*.mak', '*.mk', 'Makefile', 'makefile', 'Makefile.*', 'GNUmakefile'), ('text/x-makefile',)), + #'MakoCssLexer': ('pygments.lexers.templates', 'CSS+Mako', ('css+mako',), (), ('text/css+mako',)), + #'MakoHtmlLexer': ('pygments.lexers.templates', 'HTML+Mako', ('html+mako',), (), ('text/html+mako',)), + #'MakoJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Mako', ('js+mako', 'javascript+mako'), (), ('application/x-javascript+mako', 'text/x-javascript+mako', 'text/javascript+mako')), + #'MakoLexer': ('pygments.lexers.templates', 'Mako', ('mako',), ('*.mao',), ('application/x-mako',)), + #'MakoXmlLexer': ('pygments.lexers.templates', 'XML+Mako', ('xml+mako',), (), ('application/xml+mako',)), + #'MaqlLexer': ('pygments.lexers.business', 'MAQL', ('maql',), ('*.maql',), ('text/x-gooddata-maql', 'application/x-gooddata-maql')), + #'MaskLexer': ('pygments.lexers.javascript', 'Mask', ('mask',), ('*.mask',), ('text/x-mask',)), + #'MasonLexer': ('pygments.lexers.templates', 'Mason', ('mason',), ('*.m', '*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler'), ('application/x-mason',)), + #'MathematicaLexer': ('pygments.lexers.algebra', 'Mathematica', ('mathematica', 'mma', 'nb'), ('*.nb', '*.cdf', '*.nbp', '*.ma'), ('application/mathematica', 'application/vnd.wolfram.mathematica', 'application/vnd.wolfram.mathematica.package', 'application/vnd.wolfram.cdf')), + #'MatlabLexer': ('pygments.lexers.matlab', 'Matlab', ('matlab',), ('*.m',), ('text/matlab',)), + #'MatlabSessionLexer': ('pygments.lexers.matlab', 'Matlab session', ('matlabsession',), (), ()), + #'MiniDLexer': ('pygments.lexers.d', 'MiniD', ('minid',), (), ('text/x-minidsrc',)), + #'ModelicaLexer': ('pygments.lexers.modeling', 'Modelica', ('modelica',), ('*.mo',), ('text/x-modelica',)), + #'Modula2Lexer': ('pygments.lexers.pascal', 'Modula-2', ('modula2', 'm2'), ('*.def', '*.mod'), ('text/x-modula2',)), + #'MoinWikiLexer': ('pygments.lexers.markup', 'MoinMoin/Trac Wiki markup', ('trac-wiki', 'moin'), (), ('text/x-trac-wiki',)), + #'MonkeyLexer': ('pygments.lexers.basic', 'Monkey', ('monkey',), ('*.monkey',), ('text/x-monkey',)), + #'MoonScriptLexer': ('pygments.lexers.scripting', 'MoonScript', ('moon', 'moonscript'), ('*.moon',), ('text/x-moonscript', 'application/x-moonscript')), + #'MozPreprocCssLexer': ('pygments.lexers.markup', 'CSS+mozpreproc', ('css+mozpreproc',), ('*.css.in',), ()), + #'MozPreprocHashLexer': ('pygments.lexers.markup', 'mozhashpreproc', ('mozhashpreproc',), (), ()), + #'MozPreprocJavascriptLexer': ('pygments.lexers.markup', 'Javascript+mozpreproc', ('javascript+mozpreproc',), ('*.js.in',), ()), + #'MozPreprocPercentLexer': ('pygments.lexers.markup', 'mozpercentpreproc', ('mozpercentpreproc',), (), ()), + #'MozPreprocXulLexer': ('pygments.lexers.markup', 'XUL+mozpreproc', ('xul+mozpreproc',), ('*.xul.in',), ()), + #'MqlLexer': ('pygments.lexers.c_like', 'MQL', ('mql', 'mq4', 'mq5', 'mql4', 'mql5'), ('*.mq4', '*.mq5', '*.mqh'), ('text/x-mql',)), + #'MscgenLexer': ('pygments.lexers.dsls', 'Mscgen', ('mscgen', 'msc'), ('*.msc',), ()), + #'MuPADLexer': ('pygments.lexers.algebra', 'MuPAD', ('mupad',), ('*.mu',), ()), + #'MxmlLexer': ('pygments.lexers.actionscript', 'MXML', ('mxml',), ('*.mxml',), ()), + #'MySqlLexer': ('pygments.lexers.sql', 'MySQL', ('mysql',), (), ('text/x-mysql',)), + #'MyghtyCssLexer': ('pygments.lexers.templates', 'CSS+Myghty', ('css+myghty',), (), ('text/css+myghty',)), + #'MyghtyHtmlLexer': ('pygments.lexers.templates', 'HTML+Myghty', ('html+myghty',), (), ('text/html+myghty',)), + #'MyghtyJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Myghty', ('js+myghty', 'javascript+myghty'), (), ('application/x-javascript+myghty', 'text/x-javascript+myghty', 'text/javascript+mygthy')), + #'MyghtyLexer': ('pygments.lexers.templates', 'Myghty', ('myghty',), ('*.myt', 'autodelegate'), ('application/x-myghty',)), + #'MyghtyXmlLexer': ('pygments.lexers.templates', 'XML+Myghty', ('xml+myghty',), (), ('application/xml+myghty',)), + #'NSISLexer': ('pygments.lexers.installers', 'NSIS', ('nsis', 'nsi', 'nsh'), ('*.nsi', '*.nsh'), ('text/x-nsis',)), + 'NasmLexer': ('pygments.lexers.asm', 'NASM', ('nasm',), ('*.asm', '*.ASM'), ('text/x-nasm',)), + #'NasmObjdumpLexer': ('pygments.lexers.asm', 'objdump-nasm', ('objdump-nasm',), ('*.objdump-intel',), ('text/x-nasm-objdump',)), + #'NemerleLexer': ('pygments.lexers.dotnet', 'Nemerle', ('nemerle',), ('*.n',), ('text/x-nemerle',)), + #'NesCLexer': ('pygments.lexers.c_like', 'nesC', ('nesc',), ('*.nc',), ('text/x-nescsrc',)), + #'NewLispLexer': ('pygments.lexers.lisp', 'NewLisp', ('newlisp',), ('*.lsp', '*.nl'), ('text/x-newlisp', 'application/x-newlisp')), + #'NewspeakLexer': ('pygments.lexers.smalltalk', 'Newspeak', ('newspeak',), ('*.ns2',), ('text/x-newspeak',)), + #'NginxConfLexer': ('pygments.lexers.configs', 'Nginx configuration file', ('nginx',), (), ('text/x-nginx-conf',)), + #'NimrodLexer': ('pygments.lexers.nimrod', 'Nimrod', ('nimrod', 'nim'), ('*.nim', '*.nimrod'), ('text/x-nimrod',)), + #'NitLexer': ('pygments.lexers.nit', 'Nit', ('nit',), ('*.nit',), ()), + #'NixLexer': ('pygments.lexers.nix', 'Nix', ('nixos', 'nix'), ('*.nix',), ('text/x-nix',)), + #'NumPyLexer': ('pygments.lexers.python', 'NumPy', ('numpy',), (), ()), + #'ObjdumpLexer': ('pygments.lexers.asm', 'objdump', ('objdump',), ('*.objdump',), ('text/x-objdump',)), + 'ObjectiveCLexer': ('pygments.lexers.objective', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m', '*.h'), ('text/x-objective-c',)), + 'ObjectiveCppLexer': ('pygments.lexers.objective', 'Objective-C++', ('objective-c++', 'objectivec++', 'obj-c++', 'objc++'), ('*.mm', '*.hh'), ('text/x-objective-c++',)), + 'ObjectiveJLexer': ('pygments.lexers.javascript', 'Objective-J', ('objective-j', 'objectivej', 'obj-j', 'objj'), ('*.j',), ('text/x-objective-j',)), + 'OcamlLexer': ('pygments.lexers.ml', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)), + #'OctaveLexer': ('pygments.lexers.matlab', 'Octave', ('octave',), ('*.m',), ('text/octave',)), + #'OocLexer': ('pygments.lexers.ooc', 'Ooc', ('ooc',), ('*.ooc',), ('text/x-ooc',)), + #'OpaLexer': ('pygments.lexers.ml', 'Opa', ('opa',), ('*.opa',), ('text/x-opa',)), + #'OpenEdgeLexer': ('pygments.lexers.business', 'OpenEdge ABL', ('openedge', 'abl', 'progress'), ('*.p', '*.cls'), ('text/x-openedge', 'application/x-openedge')), + #'PanLexer': ('pygments.lexers.dsls', 'Pan', ('pan',), ('*.pan',), ()), + #'PawnLexer': ('pygments.lexers.pawn', 'Pawn', ('pawn',), ('*.p', '*.pwn', '*.inc'), ('text/x-pawn',)), + 'Perl6Lexer': ('pygments.lexers.perl', 'Perl6', ('perl6', 'pl6'), ('*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6', '*.6pm', '*.p6m', '*.pm6', '*.t'), ('text/x-perl6', 'application/x-perl6')), + 'PerlLexer': ('pygments.lexers.perl', 'Perl', ('perl', 'pl'), ('*.pl', '*.pm', '*.t'), ('text/x-perl', 'application/x-perl')), + 'PhpLexer': ('pygments.lexers.php', 'PHP', ('php', 'php3', 'php4', 'php5'), ('*.php', '*.php[345]'), ('text/x-php',)), + #'PigLexer': ('pygments.lexers.jvm', 'Pig', ('pig',), ('*.pig',), ('text/x-pig',)), + #'PikeLexer': ('pygments.lexers.c_like', 'Pike', ('pike',), ('*.pike', '*.pmod'), ('text/x-pike',)), + #'PlPgsqlLexer': ('pygments.lexers.sql', 'PL/pgSQL', ('plpgsql',), (), ('text/x-plpgsql',)), + #'PostScriptLexer': ('pygments.lexers.graphics', 'PostScript', ('postscript', 'postscr'), ('*.ps', '*.eps'), ('application/postscript',)), + #'PostgresConsoleLexer': ('pygments.lexers.sql', 'PostgreSQL console (psql)', ('psql', 'postgresql-console', 'postgres-console'), (), ('text/x-postgresql-psql',)), + #'PostgresLexer': ('pygments.lexers.sql', 'PostgreSQL SQL dialect', ('postgresql', 'postgres'), (), ('text/x-postgresql',)), + #'PovrayLexer': ('pygments.lexers.graphics', 'POVRay', ('pov',), ('*.pov', '*.inc'), ('text/x-povray',)), + 'PowerShellLexer': ('pygments.lexers.shell', 'PowerShell', ('powershell', 'posh', 'ps1', 'psm1'), ('*.ps1', '*.psm1'), ('text/x-powershell',)), + 'PrologLexer': ('pygments.lexers.prolog', 'Prolog', ('prolog',), ('*.ecl', '*.prolog', '*.pro', '*.pl'), ('text/x-prolog',)), + #'PropertiesLexer': ('pygments.lexers.configs', 'Properties', ('properties', 'jproperties'), ('*.properties',), ('text/x-java-properties',)), + #'ProtoBufLexer': ('pygments.lexers.dsls', 'Protocol Buffer', ('protobuf', 'proto'), ('*.proto',), ()), + #'PuppetLexer': ('pygments.lexers.dsls', 'Puppet', ('puppet',), ('*.pp',), ()), + #'PyPyLogLexer': ('pygments.lexers.console', 'PyPy Log', ('pypylog', 'pypy'), ('*.pypylog',), ('application/x-pypylog',)), + 'Python3Lexer': ('pygments.lexers.python', 'Python 3', ('python3', 'py3'), (), ('text/x-python3', 'application/x-python3')), + #'Python3TracebackLexer': ('pygments.lexers.python', 'Python 3.0 Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)), + #'PythonConsoleLexer': ('pygments.lexers.python', 'Python console session', ('pycon',), (), ('text/x-python-doctest',)), + 'PythonLexer': ('pygments.lexers.python', 'Python', ('python', 'py', 'sage'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac', '*.sage'), ('text/x-python', 'application/x-python')), + #'PythonTracebackLexer': ('pygments.lexers.python', 'Python Traceback', ('pytb',), ('*.pytb',), ('text/x-python-traceback',)), + #'QBasicLexer': ('pygments.lexers.basic', 'QBasic', ('qbasic', 'basic'), ('*.BAS', '*.bas'), ('text/basic',)), + #'QmlLexer': ('pygments.lexers.webmisc', 'QML', ('qml',), ('*.qml',), ('application/x-qml',)), + #'RConsoleLexer': ('pygments.lexers.r', 'RConsole', ('rconsole', 'rout'), ('*.Rout',), ()), + #'RPMSpecLexer': ('pygments.lexers.installers', 'RPMSpec', ('spec',), ('*.spec',), ('text/x-rpm-spec',)), + #'RacketLexer': ('pygments.lexers.lisp', 'Racket', ('racket', 'rkt'), ('*.rkt', '*.rktd', '*.rktl'), ('text/x-racket', 'application/x-racket')), + #'RagelCLexer': ('pygments.lexers.parsers', 'Ragel in C Host', ('ragel-c',), ('*.rl',), ()), + #'RagelCppLexer': ('pygments.lexers.parsers', 'Ragel in CPP Host', ('ragel-cpp',), ('*.rl',), ()), + #'RagelDLexer': ('pygments.lexers.parsers', 'Ragel in D Host', ('ragel-d',), ('*.rl',), ()), + #'RagelEmbeddedLexer': ('pygments.lexers.parsers', 'Embedded Ragel', ('ragel-em',), ('*.rl',), ()), + #'RagelJavaLexer': ('pygments.lexers.parsers', 'Ragel in Java Host', ('ragel-java',), ('*.rl',), ()), + #'RagelLexer': ('pygments.lexers.parsers', 'Ragel', ('ragel',), (), ()), + #'RagelObjectiveCLexer': ('pygments.lexers.parsers', 'Ragel in Objective C Host', ('ragel-objc',), ('*.rl',), ()), + #'RagelRubyLexer': ('pygments.lexers.parsers', 'Ragel in Ruby Host', ('ragel-ruby', 'ragel-rb'), ('*.rl',), ()), + #'RawTokenLexer': ('pygments.lexers.special', 'Raw token data', ('raw',), (), ('application/x-pygments-tokens',)), + #'RdLexer': ('pygments.lexers.r', 'Rd', ('rd',), ('*.Rd',), ('text/x-r-doc',)), + #'RebolLexer': ('pygments.lexers.rebol', 'REBOL', ('rebol',), ('*.r', '*.r3', '*.reb'), ('text/x-rebol',)), + #'RedLexer': ('pygments.lexers.rebol', 'Red', ('red', 'red/system'), ('*.red', '*.reds'), ('text/x-red', 'text/x-red-system')), + #'RedcodeLexer': ('pygments.lexers.esoteric', 'Redcode', ('redcode',), ('*.cw',), ()), + #'RegeditLexer': ('pygments.lexers.configs', 'reg', ('registry',), ('*.reg',), ('text/x-windows-registry',)), + #'ResourceLexer': ('pygments.lexers.resource', 'ResourceBundle', ('resource', 'resourcebundle'), ('*.txt',), ()), + #'RexxLexer': ('pygments.lexers.scripting', 'Rexx', ('rexx', 'arexx'), ('*.rexx', '*.rex', '*.rx', '*.arexx'), ('text/x-rexx',)), + #'RhtmlLexer': ('pygments.lexers.templates', 'RHTML', ('rhtml', 'html+erb', 'html+ruby'), ('*.rhtml',), ('text/html+ruby',)), + #'RobotFrameworkLexer': ('pygments.lexers.robotframework', 'RobotFramework', ('robotframework',), ('*.txt', '*.robot'), ('text/x-robotframework',)), + #'RqlLexer': ('pygments.lexers.sql', 'RQL', ('rql',), ('*.rql',), ('text/x-rql',)), + #'RslLexer': ('pygments.lexers.dsls', 'RSL', ('rsl',), ('*.rsl',), ('text/rsl',)), + #'RstLexer': ('pygments.lexers.markup', 'reStructuredText', ('rst', 'rest', 'restructuredtext'), ('*.rst', '*.rest'), ('text/x-rst', 'text/prs.fallenstein.rst')), + #'RubyConsoleLexer': ('pygments.lexers.ruby', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)), + 'RubyLexer': ('pygments.lexers.ruby', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby'), ('text/x-ruby', 'application/x-ruby')), + 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust',), ('*.rs',), ('text/x-rustsrc',)), + #'SLexer': ('pygments.lexers.r', 'S', ('splus', 's', 'r'), ('*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'), ('text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', 'text/x-R', 'text/x-r-history', 'text/x-r-profile')), + #'SMLLexer': ('pygments.lexers.ml', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')), + 'SassLexer': ('pygments.lexers.css', 'Sass', ('sass',), ('*.sass',), ('text/x-sass',)), + 'ScalaLexer': ('pygments.lexers.jvm', 'Scala', ('scala',), ('*.scala',), ('text/x-scala',)), + #'ScamlLexer': ('pygments.lexers.html', 'Scaml', ('scaml',), ('*.scaml',), ('text/x-scaml',)), + #'SchemeLexer': ('pygments.lexers.lisp', 'Scheme', ('scheme', 'scm'), ('*.scm', '*.ss'), ('text/x-scheme', 'application/x-scheme')), + #'ScilabLexer': ('pygments.lexers.matlab', 'Scilab', ('scilab',), ('*.sci', '*.sce', '*.tst'), ('text/scilab',)), + 'ScssLexer': ('pygments.lexers.css', 'SCSS', ('scss',), ('*.scss',), ('text/x-scss',)), + #'ShellSessionLexer': ('pygments.lexers.shell', 'Shell Session', ('shell-session',), ('*.shell-session',), ('application/x-sh-session',)), + #'SlimLexer': ('pygments.lexers.webmisc', 'Slim', ('slim',), ('*.slim',), ('text/x-slim',)), + #'SmaliLexer': ('pygments.lexers.dalvik', 'Smali', ('smali',), ('*.smali',), ('text/smali',)), + 'SmalltalkLexer': ('pygments.lexers.smalltalk', 'Smalltalk', ('smalltalk', 'squeak', 'st'), ('*.st',), ('text/x-smalltalk',)), + #'SmartyLexer': ('pygments.lexers.templates', 'Smarty', ('smarty',), ('*.tpl',), ('application/x-smarty',)), + #'SnobolLexer': ('pygments.lexers.snobol', 'Snobol', ('snobol',), ('*.snobol',), ('text/x-snobol',)), + #'SourcePawnLexer': ('pygments.lexers.pawn', 'SourcePawn', ('sp',), ('*.sp',), ('text/x-sourcepawn',)), + #'SourcesListLexer': ('pygments.lexers.installers', 'Debian Sourcelist', ('sourceslist', 'sources.list', 'debsources'), ('sources.list',), ()), + #'SparqlLexer': ('pygments.lexers.rdf', 'SPARQL', ('sparql',), ('*.rq', '*.sparql'), ('application/sparql-query',)), + 'SqlLexer': ('pygments.lexers.sql', 'SQL', ('sql',), ('*.sql',), ('text/x-sql',)), + #'SqliteConsoleLexer': ('pygments.lexers.sql', 'sqlite3con', ('sqlite3',), ('*.sqlite3-console',), ('text/x-sqlite3-console',)), + #'SquidConfLexer': ('pygments.lexers.configs', 'SquidConf', ('squidconf', 'squid.conf', 'squid'), ('squid.conf',), ('text/x-squidconf',)), + #'SspLexer': ('pygments.lexers.templates', 'Scalate Server Page', ('ssp',), ('*.ssp',), ('application/x-ssp',)), + #'StanLexer': ('pygments.lexers.modeling', 'Stan', ('stan',), ('*.stan',), ()), + 'SwiftLexer': ('pygments.lexers.objective', 'Swift', ('swift',), ('*.swift',), ('text/x-swift',)), + #'SwigLexer': ('pygments.lexers.c_like', 'SWIG', ('swig',), ('*.swg', '*.i'), ('text/swig',)), + #'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('systemverilog', 'sv'), ('*.sv', '*.svh'), ('text/x-systemverilog',)), + #'Tads3Lexer': ('pygments.lexers.int_fiction', 'TADS 3', ('tads3',), ('*.t',), ()), + 'TclLexer': ('pygments.lexers.tcl', 'Tcl', ('tcl',), ('*.tcl', '*.rvt'), ('text/x-tcl', 'text/x-script.tcl', 'application/x-tcl')), + 'TcshLexer': ('pygments.lexers.shell', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)), + #'TeaTemplateLexer': ('pygments.lexers.templates', 'Tea', ('tea',), ('*.tea',), ('text/x-tea',)), + #'TexLexer': ('pygments.lexers.markup', 'TeX', ('tex', 'latex'), ('*.tex', '*.aux', '*.toc'), ('text/x-tex', 'text/x-latex')), + #'TextLexer': ('pygments.lexers.special', 'Text only', ('text',), ('*.txt',), ('text/plain',)), + #'TodotxtLexer': ('pygments.lexers.textfmts', 'Todotxt', ('todotxt',), ('todo.txt', '*.todotxt'), ('text/x-todo',)), + #'TreetopLexer': ('pygments.lexers.parsers', 'Treetop', ('treetop',), ('*.treetop', '*.tt'), ()), + #'TwigHtmlLexer': ('pygments.lexers.templates', 'HTML+Twig', ('html+twig',), ('*.twig',), ('text/html+twig',)), + #'TwigLexer': ('pygments.lexers.templates', 'Twig', ('twig',), (), ('application/x-twig',)), + 'TypeScriptLexer': ('pygments.lexers.javascript', 'TypeScript', ('ts',), ('*.ts',), ('text/x-typescript',)), + #'UrbiscriptLexer': ('pygments.lexers.urbi', 'UrbiScript', ('urbiscript',), ('*.u',), ('application/x-urbiscript',)), + #'VCTreeStatusLexer': ('pygments.lexers.console', 'VCTreeStatus', ('vctreestatus',), (), ()), + #'VGLLexer': ('pygments.lexers.dsls', 'VGL', ('vgl',), ('*.rpf',), ()), + #'ValaLexer': ('pygments.lexers.c_like', 'Vala', ('vala', 'vapi'), ('*.vala', '*.vapi'), ('text/x-vala',)), + 'VbNetAspxLexer': ('pygments.lexers.dotnet', 'aspx-vb', ('aspx-vb',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()), + 'VbNetLexer': ('pygments.lexers.dotnet', 'VB.net', ('vb.net', 'vbnet'), ('*.vb', '*.bas'), ('text/x-vbnet', 'text/x-vba')), + #'VelocityHtmlLexer': ('pygments.lexers.templates', 'HTML+Velocity', ('html+velocity',), (), ('text/html+velocity',)), + #'VelocityLexer': ('pygments.lexers.templates', 'Velocity', ('velocity',), ('*.vm', '*.fhtml'), ()), + #'VelocityXmlLexer': ('pygments.lexers.templates', 'XML+Velocity', ('xml+velocity',), (), ('application/xml+velocity',)), + 'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('verilog', 'v'), ('*.v',), ('text/x-verilog',)), + 'VhdlLexer': ('pygments.lexers.hdl', 'vhdl', ('vhdl',), ('*.vhdl', '*.vhd'), ('text/x-vhdl',)), + #'VimLexer': ('pygments.lexers.textedit', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc'), ('text/x-vim',)), + #'XQueryLexer': ('pygments.lexers.webmisc', 'XQuery', ('xquery', 'xqy', 'xq', 'xql', 'xqm'), ('*.xqy', '*.xquery', '*.xq', '*.xql', '*.xqm'), ('text/xquery', 'application/xquery')), + #'XmlDjangoLexer': ('pygments.lexers.templates', 'XML+Django/Jinja', ('xml+django', 'xml+jinja'), (), ('application/xml+django', 'application/xml+jinja')), + #'XmlErbLexer': ('pygments.lexers.templates', 'XML+Ruby', ('xml+erb', 'xml+ruby'), (), ('application/xml+ruby',)), + #'XmlLexer': ('pygments.lexers.html', 'XML', ('xml',), ('*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl', '*.wsf'), ('text/xml', 'application/xml', 'image/svg+xml', 'application/rss+xml', 'application/atom+xml')), + #'XmlPhpLexer': ('pygments.lexers.templates', 'XML+PHP', ('xml+php',), (), ('application/xml+php',)), + #'XmlSmartyLexer': ('pygments.lexers.templates', 'XML+Smarty', ('xml+smarty',), (), ('application/xml+smarty',)), + #'XsltLexer': ('pygments.lexers.html', 'XSLT', ('xslt',), ('*.xsl', '*.xslt', '*.xpl'), ('application/xsl+xml', 'application/xslt+xml')), + #'XtendLexer': ('pygments.lexers.jvm', 'Xtend', ('xtend',), ('*.xtend',), ('text/x-xtend',)), + #'YamlJinjaLexer': ('pygments.lexers.templates', 'YAML+Jinja', ('yaml+jinja', 'salt', 'sls'), ('*.sls',), ('text/x-yaml+jinja', 'text/x-sls')), + #'YamlLexer': ('pygments.lexers.data', 'YAML', ('yaml',), ('*.yaml', '*.yml'), ('text/x-yaml',)), + #'ZephirLexer': ('pygments.lexers.php', 'Zephir', ('zephir',), ('*.zep',), ()), +} diff --git a/thirdparty/prod/pygments.LICENSE b/src/typecode/pygments.NOTICE similarity index 95% rename from thirdparty/prod/pygments.LICENSE rename to src/typecode/pygments.NOTICE index 314b37105c4..21815527ff1 100644 --- a/thirdparty/prod/pygments.LICENSE +++ b/src/typecode/pygments.NOTICE @@ -1,4 +1,4 @@ -Copyright (c) 2006-2011 by the respective authors (see AUTHORS file). +Copyright (c) 2006-2017 by the respective authors (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/typecode/pygments_lexers.ABOUT b/src/typecode/pygments_lexers.ABOUT new file mode 100644 index 00000000000..f73bfdc71b3 --- /dev/null +++ b/src/typecode/pygments_lexers.ABOUT @@ -0,0 +1,21 @@ +about_resource: pygments_lexers.py +attribute: true +copyright: Copyright by the Pygments team +download_url: https://pypi.python.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl#md5=ce67fc58b51ffd29a2de8b97fcda274a +homepage_url: http://pygments.org/ +license_expression: bsd-simplified +licenses: +- file: bsd-simplified.LICENSE + key: bsd-simplified + name: BSD-2-Clause +name: Pygments +notice_file: pygments.NOTICE +notice_url: https://bitbucket.org/birkenfeld/pygments-main/src/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/LICENSE?at=default&fileviewer=file-view-default +owner: Pocoo Team +owner_url: http://www.pocoo.org/ +track_changes: true +vcs_repository: http://bitbucket.org/birkenfeld/pygments-main +version: 2.2.0 + +vcs_tool: hg +notes: this is a tiny subset of Pygments to focus on programming languages detection only. \ No newline at end of file diff --git a/src/typecode/pygments_lexers.py b/src/typecode/pygments_lexers.py new file mode 100644 index 00000000000..509b30a1ad0 --- /dev/null +++ b/src/typecode/pygments_lexers.py @@ -0,0 +1,261 @@ +# -*- coding: utf-8 -*- +""" + pygments.lexers + ~~~~~~~~~~~~~~~ + + Pygments lexers. + + :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import sys +import types +import fnmatch +from os.path import basename + +from typecode.prog_lexers import LEXERS + +from pygments.modeline import get_filetype_from_buffer +from pygments.plugin import find_plugin_lexers +from pygments.util import ClassNotFound, itervalues, guess_decode + + +_lexer_cache = {} +_pattern_cache = {} + + +def _fn_matches(fn, glob): + """Return whether the supplied file name fn matches pattern filename.""" + if glob not in _pattern_cache: + pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob), re.IGNORECASE) + return pattern.match(fn) + return _pattern_cache[glob].match(fn) + + +def _load_lexers(module_name): + """Load a lexer (and all others in the module too).""" + mod = __import__(module_name, None, None, ['__all__']) + for lexer_name in mod.__all__: + cls = getattr(mod, lexer_name) + _lexer_cache[cls.name] = cls + + +def get_all_lexers(): + """Return a generator of tuples in the form ``(name, aliases, + filenames, mimetypes)`` of all know lexers. + """ + for item in itervalues(LEXERS): + yield item[1:] + for lexer in find_plugin_lexers(): + yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes + + +def find_lexer_class(name): + """Lookup a lexer class by name. + + Return None if not found. + """ + if name in _lexer_cache: + return _lexer_cache[name] + # lookup builtin lexers + for module_name, lname, aliases, _, _ in itervalues(LEXERS): + if name == lname: + _load_lexers(module_name) + return _lexer_cache[name] + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if cls.name == name: + return cls + + +def get_lexer_by_name(_alias, **options): + """Get a lexer by an alias. + + Raises ClassNotFound if not found. + """ + if not _alias: + raise ClassNotFound('no lexer for alias %r found' % _alias) + + # lookup builtin lexers + for module_name, name, aliases, _, _ in itervalues(LEXERS): + if _alias.lower() in aliases: + if name not in _lexer_cache: + _load_lexers(module_name) + return _lexer_cache[name](**options) + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if _alias in cls.aliases: + return cls(**options) + raise ClassNotFound('no lexer for alias %r found' % _alias) + + +def find_lexer_class_for_filename(_fn, code=None): + """Get a lexer for a filename. + + If multiple lexers match the filename pattern, use ``analyse_text()`` to + figure out which one is more appropriate. + + Returns None if not found. + """ + matches = [] + fn = basename(_fn) + for modname, name, _, filenames, _ in itervalues(LEXERS): + for filename in filenames: + if _fn_matches(fn, filename): + if name not in _lexer_cache: + _load_lexers(modname) + matches.append((_lexer_cache[name], filename)) + for cls in find_plugin_lexers(): + for filename in cls.filenames: + if _fn_matches(fn, filename): + matches.append((cls, filename)) + + if sys.version_info > (3,) and isinstance(code, bytes): + # decode it, since all analyse_text functions expect unicode + code = guess_decode(code) + + def get_rating(info): + cls, filename = info + # explicit patterns get a bonus + bonus = '*' not in filename and 0.5 or 0 + # The class _always_ defines analyse_text because it's included in + # the Lexer class. The default implementation returns None which + # gets turned into 0.0. Run scripts/detect_missing_analyse_text.py + # to find lexers which need it overridden. + if code: + return cls.analyse_text(code) + bonus + return cls.priority + bonus + + if matches: + matches.sort(key=get_rating) + # print "Possible lexers, after sort:", matches + return matches[-1][0] + + +def get_lexer_for_filename(_fn, code=None, **options): + """Get a lexer for a filename. + + If multiple lexers match the filename pattern, use ``analyse_text()`` to + figure out which one is more appropriate. + + Raises ClassNotFound if not found. + """ + res = find_lexer_class_for_filename(_fn, code) + if not res: + raise ClassNotFound('no lexer for filename %r found' % _fn) + return res(**options) + + +def get_lexer_for_mimetype(_mime, **options): + """Get a lexer for a mimetype. + + Raises ClassNotFound if not found. + """ + for modname, name, _, _, mimetypes in itervalues(LEXERS): + if _mime in mimetypes: + if name not in _lexer_cache: + _load_lexers(modname) + return _lexer_cache[name](**options) + for cls in find_plugin_lexers(): + if _mime in cls.mimetypes: + return cls(**options) + raise ClassNotFound('no lexer for mimetype %r found' % _mime) + + +def _iter_lexerclasses(plugins=True): + """Return an iterator over all lexer classes.""" + for key in sorted(LEXERS): + module_name, name = LEXERS[key][:2] + if name not in _lexer_cache: + _load_lexers(module_name) + yield _lexer_cache[name] + if plugins: + for lexer in find_plugin_lexers(): + yield lexer + + +def guess_lexer_for_filename(_fn, _text, **options): + """ + Lookup all lexers that handle those filenames primary (``filenames``) + or secondary (``alias_filenames``). Then run a text analysis for those + lexers and choose the best result. + """ + fn = basename(_fn) + primary = {} + matching_lexers = set() + for lexer in _iter_lexerclasses(): + for filename in lexer.filenames: + if _fn_matches(fn, filename): + matching_lexers.add(lexer) + primary[lexer] = True + for filename in lexer.alias_filenames: + if _fn_matches(fn, filename): + matching_lexers.add(lexer) + primary[lexer] = False + if not matching_lexers: + raise ClassNotFound('no lexer for filename %r found' % fn) + if len(matching_lexers) == 1: + return matching_lexers.pop()(**options) + result = [] + for lexer in matching_lexers: + rv = lexer.analyse_text(_text) + if rv == 1.0: + return lexer(**options) + result.append((rv, lexer)) + + def type_sort(t): + # sort by: + # - analyse score + # - is primary filename pattern? + # - priority + # - last resort: class name + return (t[0], primary[t[1]], t[1].priority, t[1].__name__) + result.sort(key=type_sort) + + return result[-1][1](**options) + + +def guess_lexer(_text, **options): + """Guess a lexer by strong distinctions in the text (eg, shebang).""" + + # try to get a vim modeline first + ft = get_filetype_from_buffer(_text) + + if ft is not None: + try: + return get_lexer_by_name(ft, **options) + except ClassNotFound: + pass + + best_lexer = [0.0, None] + for lexer in _iter_lexerclasses(): + rv = lexer.analyse_text(_text) + if rv == 1.0: + return lexer(**options) + if rv > best_lexer[0]: + best_lexer[:] = (rv, lexer) + if not best_lexer[0] or best_lexer[1] is None: + raise ClassNotFound('no lexer matching the text found') + return best_lexer[1](**options) + + +class _automodule(types.ModuleType): + """Automatically import lexers.""" + + def __getattr__(self, name): + info = LEXERS.get(name) + if info: + _load_lexers(info[0]) + cls = _lexer_cache[info[1]] + setattr(self, name, cls) + return cls + raise AttributeError(name) + + +oldmod = sys.modules[__name__] +newmod = _automodule(__name__) +newmod.__dict__.update(oldmod.__dict__) +sys.modules[__name__] = newmod +del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index 1300677170e..ee5615aef6a 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,14 +1,14 @@ Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,license__key,license__score,license__name,license__short_name,license__category,license__is_exception,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_expression,matched_rule__licenses,matched_rule__is_license_text,matched_rule__is_license_notice,matched_rule__is_license_reference,matched_rule__is_license_tag,copyright,copyright_holder,email,url,package__type,package__namespace,package__name,package__version,package__qualifiers,package__subpath,package__primary_language,package__code_type,package__description,package__size,package__release_date,package__homepage_url,package__download_url,package__bug_tracking_url,package__code_view_url,package__vcs_tool,package__vcs_repository,package__vcs_revision,package__copyright,package__license_expression,package__declared_licensing,package__notice_text,package__manifest_path,package__source_packages -/json2csv.rb,file,json2csv.rb,json2csv,.rb,1014,2018-04-11,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/json2csv.rb,file,json2csv.rb,json2csv,.rb,1014,2018-10-15,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.53,Apache License 2.0,Apache 2.0,Permissive,False,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,apache-2.0,[u'apache-2.0'],False,True,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,http://nexb.com/,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,,,,,,,,,,, /json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,,,,,,,,,,, -/license,file,license,license,,679,2018-04-11,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/license,file,license,license,,679,2018-10-15,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GNU General Public License 2.0 or later,GPL 2.0 or later,Copyleft,False,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0-or-later,https://spdx.org/licenses/GPL-2.0-or-later,1,12,gpl-2.0-plus.LICENSE,gpl-2.0-plus,[u'gpl-2.0-plus'],True,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,package,.json,2200,2018-04-11,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",JSON,False,True,False,False,True,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +/package.json,file,package.json,package,.json,2200,2018-10-15,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,mit,99.40,MIT License,MIT License,Permissive,False,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_31.RULE,mit,[u'mit'],True,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,Copyright (c) 2012 LearnBoost ,,,,,,,,,,,,,,,,,,,,,,,,,,, /package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,,LearnBoost,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index e7e4d5ec82a..035c3ad7b1d 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -50,7 +50,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index c643a3ffdd4..a3c5518940c 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -50,7 +50,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index 9859de2b952..c6703394a51 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -50,7 +50,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/formattedcode/data/json/tree/expected.json b/tests/formattedcode/data/json/tree/expected.json index 4342d85790a..da4f5216d87 100644 --- a/tests/formattedcode/data/json/tree/expected.json +++ b/tests/formattedcode/data/json/tree/expected.json @@ -22,7 +22,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -63,7 +63,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -104,7 +104,7 @@ "md5": "e999e21c9d7de4d0f943aefbb6f21b99", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -174,7 +174,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -215,7 +215,7 @@ "md5": "fc7f53659b7a9db8b6dff0638641778e", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -256,7 +256,7 @@ "md5": "290627a1387288ef77ae7e07946f3ecf", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -297,7 +297,7 @@ "md5": "88e46475db9b1a68f415f6a3544eeb16", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/altpath/copyright.expected.json b/tests/scancode/data/altpath/copyright.expected.json index c347f5050a7..5e0c0ac2dc6 100644 --- a/tests/scancode/data/altpath/copyright.expected.json +++ b/tests/scancode/data/altpath/copyright.expected.json @@ -20,7 +20,7 @@ "md5": "bdf7c572beb4094c2059508fa73c05a4", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text, with no line terminators", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/info/all.expected.json b/tests/scancode/data/info/all.expected.json index 3c664d4af05..d0e9d63dd58 100644 --- a/tests/scancode/data/info/all.expected.json +++ b/tests/scancode/data/info/all.expected.json @@ -360,7 +360,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "mime_type": "text/x-c", "file_type": "C source, ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/info/basic.expected.json b/tests/scancode/data/info/basic.expected.json index bc955859f59..c92aac3583b 100644 --- a/tests/scancode/data/info/basic.expected.json +++ b/tests/scancode/data/info/basic.expected.json @@ -260,7 +260,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "mime_type": "text/x-c", "file_type": "C source, ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/info/basic.rooted.expected.json b/tests/scancode/data/info/basic.rooted.expected.json index cbb8333b1d3..ca5d466fba3 100644 --- a/tests/scancode/data/info/basic.rooted.expected.json +++ b/tests/scancode/data/info/basic.rooted.expected.json @@ -283,7 +283,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "mime_type": "text/x-c", "file_type": "C source, ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/info/email_url_info.expected.json b/tests/scancode/data/info/email_url_info.expected.json index bbc1ac28045..4898d824874 100644 --- a/tests/scancode/data/info/email_url_info.expected.json +++ b/tests/scancode/data/info/email_url_info.expected.json @@ -300,7 +300,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "mime_type": "text/x-c", "file_type": "C source, ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/plugin_only_findings/expected.json b/tests/scancode/data/plugin_only_findings/expected.json index f546767a0f1..980860ac244 100644 --- a/tests/scancode/data/plugin_only_findings/expected.json +++ b/tests/scancode/data/plugin_only_findings/expected.json @@ -99,7 +99,7 @@ "md5": "8d0a3b3fe1c96a49af2a66040193291b", "mime_type": "text/x-c", "file_type": "C source, ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/scancode/data/single/iproute.expected.json b/tests/scancode/data/single/iproute.expected.json index 2f9a4e33c56..51e6466cf21 100644 --- a/tests/scancode/data/single/iproute.expected.json +++ b/tests/scancode/data/single/iproute.expected.json @@ -19,7 +19,7 @@ "md5": "b8e7112a6e82921687fd1e008e72058f", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/summarycode/data/classify/cli.expected.json b/tests/summarycode/data/classify/cli.expected.json index 836029fc446..c0e7b8370e3 100644 --- a/tests/summarycode/data/classify/cli.expected.json +++ b/tests/summarycode/data/classify/cli.expected.json @@ -100,12 +100,12 @@ "md5": null, "mime_type": "inode/x-empty", "file_type": "empty", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "is_legal": false, "is_manifest": true, @@ -127,12 +127,12 @@ "md5": null, "mime_type": "inode/x-empty", "file_type": "empty", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "is_legal": false, "is_manifest": true, @@ -181,12 +181,12 @@ "md5": null, "mime_type": "inode/x-empty", "file_type": "empty", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "is_legal": false, "is_manifest": true, @@ -208,7 +208,7 @@ "md5": null, "mime_type": "inode/x-empty", "file_type": "empty", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -235,7 +235,7 @@ "md5": null, "mime_type": "inode/x-empty", "file_type": "empty", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -262,12 +262,12 @@ "md5": null, "mime_type": "inode/x-empty", "file_type": "empty", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "is_legal": false, "is_manifest": false, diff --git a/tests/summarycode/data/copyright_summary/summary_key_files.expected.json b/tests/summarycode/data/copyright_summary/summary_key_files.expected.json index 3842c3bab64..7d6bfcd0150 100644 --- a/tests/summarycode/data/copyright_summary/summary_key_files.expected.json +++ b/tests/summarycode/data/copyright_summary/summary_key_files.expected.json @@ -131,24 +131,20 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { "value": "Java", "count": 7 }, - { - "value": "C#", - "count": 2 - }, { "value": null, - "count": 1 + "count": 2 }, { - "value": "Ada", - "count": 1 + "value": "C#", + "count": 2 }, { "value": "GAS", @@ -626,7 +622,7 @@ "md5": "92011414f344e34f711e77bac40e4bc4", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -668,7 +664,7 @@ "md5": "4ed53ac605f16247ab7d571670f2351d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -710,7 +706,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -812,12 +808,12 @@ "md5": "4e58eb393ad904c1de81a9ca5b9e392c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "Ada", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "holders": [ { @@ -854,7 +850,7 @@ "md5": "48c4037f16b4670795fdf72e88cc278c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -896,7 +892,7 @@ "md5": "f11ed826baf25f2bfa9c610313460036", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -938,7 +934,7 @@ "md5": "d8821cd288e2be7fd83cdcac22a427ce", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1202,7 +1198,7 @@ "md5": "d570bd029ee2362f2a0927c87999773b", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1244,7 +1240,7 @@ "md5": "2913c8ea7fb43a0f469bb2797c820a95", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1316,7 +1312,7 @@ "md5": "8b897171ea0767232e586086bc94518c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1358,7 +1354,7 @@ "md5": "07497e2688dad9406386f0534a0bbfca", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1400,7 +1396,7 @@ "md5": "2a0ea6a99e31fb0989209a027476038d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1442,7 +1438,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/summarycode/data/end-2-end/bug-1141.expected.json b/tests/summarycode/data/end-2-end/bug-1141.expected.json index 3b589e09dba..0ba0c001709 100644 --- a/tests/summarycode/data/end-2-end/bug-1141.expected.json +++ b/tests/summarycode/data/end-2-end/bug-1141.expected.json @@ -66,7 +66,7 @@ "count": 2 }, { - "value": "C", + "value": "C++", "count": 2 } ] @@ -459,7 +459,7 @@ "md5": "a4028ec638973696ece447f4790b3436", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -537,7 +537,7 @@ "md5": "6cc4c13ec154a8f58b09b6566345f0b0", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/summarycode/data/full_summary/summary.expected.json b/tests/summarycode/data/full_summary/summary.expected.json index 8b097c9cd89..6687e51c91a 100644 --- a/tests/summarycode/data/full_summary/summary.expected.json +++ b/tests/summarycode/data/full_summary/summary.expected.json @@ -169,7 +169,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { @@ -178,23 +178,15 @@ }, { "value": null, - "count": 2 + "count": 4 }, { "value": "C#", "count": 2 }, - { - "value": "Ada", - "count": 1 - }, { "value": "GAS", "count": 1 - }, - { - "value": "JSON", - "count": 1 } ] }, @@ -3583,7 +3575,7 @@ "md5": "92011414f344e34f711e77bac40e4bc4", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -3654,7 +3646,7 @@ "md5": "4ed53ac605f16247ab7d571670f2351d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -3725,7 +3717,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -3855,12 +3847,12 @@ "md5": "62b51527599b11b32361699c75b05683", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -3972,12 +3964,12 @@ "md5": "4e58eb393ad904c1de81a9ca5b9e392c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "Ada", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -4072,7 +4064,7 @@ "md5": "48c4037f16b4670795fdf72e88cc278c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4143,7 +4135,7 @@ "md5": "f11ed826baf25f2bfa9c610313460036", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4214,7 +4206,7 @@ "md5": "d8821cd288e2be7fd83cdcac22a427ce", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4561,7 +4553,7 @@ "md5": "d570bd029ee2362f2a0927c87999773b", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4632,7 +4624,7 @@ "md5": "2913c8ea7fb43a0f469bb2797c820a95", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4732,7 +4724,7 @@ "md5": "8b897171ea0767232e586086bc94518c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4803,7 +4795,7 @@ "md5": "07497e2688dad9406386f0534a0bbfca", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4874,7 +4866,7 @@ "md5": "2a0ea6a99e31fb0989209a027476038d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4945,7 +4937,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/summarycode/data/full_summary/summary_by_facet.expected.json b/tests/summarycode/data/full_summary/summary_by_facet.expected.json index c125bac6a09..3ac3b2df47e 100644 --- a/tests/summarycode/data/full_summary/summary_by_facet.expected.json +++ b/tests/summarycode/data/full_summary/summary_by_facet.expected.json @@ -177,7 +177,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { @@ -186,23 +186,15 @@ }, { "value": null, - "count": 2 + "count": 4 }, { "value": "C#", "count": 2 }, - { - "value": "Ada", - "count": 1 - }, { "value": "GAS", "count": 1 - }, - { - "value": "JSON", - "count": 1 } ] }, @@ -280,16 +272,12 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 10 }, { "value": null, - "count": 1 - }, - { - "value": "JSON", - "count": 1 + "count": 2 } ] } @@ -403,7 +391,7 @@ "count": 2 }, { - "value": "Ada", + "value": null, "count": 1 } ] @@ -438,7 +426,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 2 } ] @@ -1093,7 +1081,7 @@ "md5": "92011414f344e34f711e77bac40e4bc4", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1166,7 +1154,7 @@ "md5": "4ed53ac605f16247ab7d571670f2351d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1239,7 +1227,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1373,12 +1361,12 @@ "md5": "62b51527599b11b32361699c75b05683", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -1492,12 +1480,12 @@ "md5": "4e58eb393ad904c1de81a9ca5b9e392c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "Ada", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -1594,7 +1582,7 @@ "md5": "48c4037f16b4670795fdf72e88cc278c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1667,7 +1655,7 @@ "md5": "f11ed826baf25f2bfa9c610313460036", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1740,7 +1728,7 @@ "md5": "d8821cd288e2be7fd83cdcac22a427ce", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2095,7 +2083,7 @@ "md5": "d570bd029ee2362f2a0927c87999773b", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2168,7 +2156,7 @@ "md5": "2913c8ea7fb43a0f469bb2797c820a95", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2270,7 +2258,7 @@ "md5": "8b897171ea0767232e586086bc94518c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2343,7 +2331,7 @@ "md5": "07497e2688dad9406386f0534a0bbfca", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2416,7 +2404,7 @@ "md5": "2a0ea6a99e31fb0989209a027476038d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2489,7 +2477,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/summarycode/data/full_summary/summary_details.expected.json b/tests/summarycode/data/full_summary/summary_details.expected.json index 5c94e1cfdfd..24fe7c08497 100644 --- a/tests/summarycode/data/full_summary/summary_details.expected.json +++ b/tests/summarycode/data/full_summary/summary_details.expected.json @@ -169,7 +169,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { @@ -178,23 +178,15 @@ }, { "value": null, - "count": 2 + "count": 4 }, { "value": "C#", "count": 2 }, - { - "value": "Ada", - "count": 1 - }, { "value": "GAS", "count": 1 - }, - { - "value": "JSON", - "count": 1 } ] }, @@ -3215,7 +3207,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { @@ -3224,23 +3216,15 @@ }, { "value": null, - "count": 2 + "count": 4 }, { "value": "C#", "count": 2 }, - { - "value": "Ada", - "count": 1 - }, { "value": "GAS", "count": 1 - }, - { - "value": "JSON", - "count": 1 } ] }, @@ -4206,7 +4190,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 3 } ] @@ -4227,7 +4211,7 @@ "md5": "92011414f344e34f711e77bac40e4bc4", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4309,7 +4293,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -4330,7 +4314,7 @@ "md5": "4ed53ac605f16247ab7d571670f2351d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4412,7 +4396,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -4433,7 +4417,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -4515,7 +4499,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -4627,12 +4611,12 @@ "md5": "62b51527599b11b32361699c75b05683", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -4697,7 +4681,7 @@ ], "programming_language": [ { - "value": "JSON", + "value": null, "count": 1 } ] @@ -4830,7 +4814,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 9 }, { @@ -4838,7 +4822,7 @@ "count": 2 }, { - "value": "Ada", + "value": null, "count": 1 }, { @@ -4903,7 +4887,7 @@ ], "programming_language": [ { - "value": "Ada", + "value": null, "count": 1 } ] @@ -4924,12 +4908,12 @@ "md5": "4e58eb393ad904c1de81a9ca5b9e392c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "Ada", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -5035,7 +5019,7 @@ ], "programming_language": [ { - "value": "Ada", + "value": null, "count": 1 } ] @@ -5056,7 +5040,7 @@ "md5": "48c4037f16b4670795fdf72e88cc278c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -5138,7 +5122,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -5159,7 +5143,7 @@ "md5": "f11ed826baf25f2bfa9c610313460036", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -5241,7 +5225,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -5262,7 +5246,7 @@ "md5": "d8821cd288e2be7fd83cdcac22a427ce", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -5344,7 +5328,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -5820,7 +5804,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 2 } ] @@ -5841,7 +5825,7 @@ "md5": "d570bd029ee2362f2a0927c87999773b", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -5923,7 +5907,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -5944,7 +5928,7 @@ "md5": "2913c8ea7fb43a0f469bb2797c820a95", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -6026,7 +6010,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -6087,7 +6071,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -6108,7 +6092,7 @@ "md5": "8b897171ea0767232e586086bc94518c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -6190,7 +6174,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -6211,7 +6195,7 @@ "md5": "07497e2688dad9406386f0534a0bbfca", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -6293,7 +6277,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -6314,7 +6298,7 @@ "md5": "2a0ea6a99e31fb0989209a027476038d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -6396,7 +6380,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] @@ -6417,7 +6401,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -6499,7 +6483,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 1 } ] diff --git a/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines b/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines index 2b2beb4f2c1..b083c55a18c 100644 --- a/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines +++ b/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines @@ -175,7 +175,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { @@ -184,23 +184,15 @@ }, { "value": null, - "count": 2 + "count": 4 }, { "value": "C#", "count": 2 }, - { - "value": "Ada", - "count": 1 - }, { "value": "GAS", "count": 1 - }, - { - "value": "JSON", - "count": 1 } ] } @@ -242,11 +234,7 @@ "programming_language": [ { "value": null, - "count": 2 - }, - { - "value": "JSON", - "count": 1 + "count": 3 } ] } @@ -366,12 +354,12 @@ "md5": "62b51527599b11b32361699c75b05683", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -504,7 +492,7 @@ "md5": "92011414f344e34f711e77bac40e4bc4", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -582,7 +570,7 @@ "md5": "4ed53ac605f16247ab7d571670f2351d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -660,7 +648,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1290,7 +1278,7 @@ "md5": "48c4037f16b4670795fdf72e88cc278c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1368,7 +1356,7 @@ "md5": "f11ed826baf25f2bfa9c610313460036", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1446,7 +1434,7 @@ "md5": "d8821cd288e2be7fd83cdcac22a427ce", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1524,7 +1512,7 @@ "md5": "07497e2688dad9406386f0534a0bbfca", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1602,7 +1590,7 @@ "md5": "2a0ea6a99e31fb0989209a027476038d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1680,7 +1668,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1794,12 +1782,12 @@ "md5": "4e58eb393ad904c1de81a9ca5b9e392c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "Ada", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -2219,7 +2207,7 @@ "md5": "d570bd029ee2362f2a0927c87999773b", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2297,7 +2285,7 @@ "md5": "2913c8ea7fb43a0f469bb2797c820a95", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2411,7 +2399,7 @@ "md5": "8b897171ea0767232e586086bc94518c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/summarycode/data/full_summary/summary_key_files.expected.json b/tests/summarycode/data/full_summary/summary_key_files.expected.json index 1be93af1d8f..a0d7498c5b2 100644 --- a/tests/summarycode/data/full_summary/summary_key_files.expected.json +++ b/tests/summarycode/data/full_summary/summary_key_files.expected.json @@ -170,7 +170,7 @@ ], "programming_language": [ { - "value": "C", + "value": "C++", "count": 12 }, { @@ -179,23 +179,15 @@ }, { "value": null, - "count": 2 + "count": 4 }, { "value": "C#", "count": 2 }, - { - "value": "Ada", - "count": 1 - }, { "value": "GAS", "count": 1 - }, - { - "value": "JSON", - "count": 1 } ] }, @@ -235,11 +227,7 @@ "programming_language": [ { "value": null, - "count": 2 - }, - { - "value": "JSON", - "count": 1 + "count": 3 } ] }, @@ -831,7 +819,7 @@ "md5": "92011414f344e34f711e77bac40e4bc4", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -905,7 +893,7 @@ "md5": "4ed53ac605f16247ab7d571670f2351d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -979,7 +967,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1115,12 +1103,12 @@ "md5": "62b51527599b11b32361699c75b05683", "mime_type": "text/plain", "file_type": "UTF-8 Unicode text", - "programming_language": "JSON", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -1241,12 +1229,12 @@ "md5": "4e58eb393ad904c1de81a9ca5b9e392c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "Ada", + "programming_language": null, "is_binary": false, "is_text": true, "is_archive": false, "is_media": false, - "is_source": true, + "is_source": false, "is_script": false, "licenses": [ { @@ -1344,7 +1332,7 @@ "md5": "48c4037f16b4670795fdf72e88cc278c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1418,7 +1406,7 @@ "md5": "f11ed826baf25f2bfa9c610313460036", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1492,7 +1480,7 @@ "md5": "d8821cd288e2be7fd83cdcac22a427ce", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1860,7 +1848,7 @@ "md5": "d570bd029ee2362f2a0927c87999773b", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -1934,7 +1922,7 @@ "md5": "2913c8ea7fb43a0f469bb2797c820a95", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2040,7 +2028,7 @@ "md5": "8b897171ea0767232e586086bc94518c", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2114,7 +2102,7 @@ "md5": "07497e2688dad9406386f0534a0bbfca", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2188,7 +2176,7 @@ "md5": "2a0ea6a99e31fb0989209a027476038d", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, @@ -2262,7 +2250,7 @@ "md5": "807b91d2bf5e18de555e56de37e487d1", "mime_type": "text/plain", "file_type": "ASCII text", - "programming_language": "C", + "programming_language": "C++", "is_binary": false, "is_text": true, "is_archive": false, diff --git a/tests/typecode/data/contenttype/package/package.json b/tests/typecode/data/contenttype/package/package.json new file mode 100644 index 00000000000..c249f1f8484 --- /dev/null +++ b/tests/typecode/data/contenttype/package/package.json @@ -0,0 +1,31 @@ +{ + "name": "cookie-signature", + "version": "1.0.3", + "description": "Sign and unsign cookies", + "keywords": [ + "cookie", + "sign", + "unsign" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@learnboost.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/visionmedia/node-cookie-signature.git" + }, + "dependencies": {}, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "main": "index", + "readme": "\n# cookie-signature\n\n Sign and unsign cookies.\n\n## Example\n\n```js\nvar cookie = require('cookie-signature');\n\nvar val = cookie.sign('hello', 'tobiiscool');\nval.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');\n\nvar val = cookie.sign('hello', 'tobiiscool');\ncookie.unsign(val, 'tobiiscool').should.equal('hello');\ncookie.unsign(val, 'luna').should.be.false;\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 LearnBoost <tj@learnboost.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", + "readmeFilename": "Readme.md", + "bugs": { + "url": "https://github.com/visionmedia/node-cookie-signature/issues" + }, + "_id": "cookie-signature@1.0.3", + "_from": "cookie-signature@1.0.3" +} diff --git a/tests/typecode/test_contenttype.py b/tests/typecode/test_contenttype.py index 96ed6ff17f0..b898e068680 100644 --- a/tests/typecode/test_contenttype.py +++ b/tests/typecode/test_contenttype.py @@ -32,8 +32,9 @@ from unittest.case import expectedFailure from commoncode.testcase import FileBasedTesting -from commoncode.system import on_windows from commoncode.system import on_linux +from commoncode.system import on_mac +from commoncode.system import on_windows from typecode.contenttype import get_filetype from typecode.contenttype import get_type @@ -51,6 +52,7 @@ is_media = lambda l: get_type(l).is_media is_winexe = lambda l: get_type(l).is_winexe is_source = lambda l: get_type(l).is_source +is_script = lambda l: get_type(l).is_script is_special = lambda l: get_type(l).is_special is_pdf = lambda l: get_type(l).is_pdf is_pdf_with_text = lambda l: get_type(l).is_pdf_with_text @@ -157,6 +159,7 @@ def test_directory(self): assert not is_binary(test_file) assert not is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_archive_gnu_tar(self): test_file = self.get_test_loc('contenttype/archive/e.tar') @@ -165,6 +168,7 @@ def test_archive_gnu_tar(self): assert is_archive(test_file) assert not is_compressed(test_file) assert contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_debian_package(self): test_file = self.get_test_loc('contenttype/package/libjama-dev_1.2.4-2_all.deb') @@ -173,6 +177,14 @@ def test_debian_package(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) + + def test_package_json(self): + test_file = self.get_test_loc('contenttype/package/package.json') + assert 'ascii text, with very long lines' == get_filetype(test_file) + assert not is_binary(test_file) + assert '' == get_filetype_pygment(test_file) + assert not is_source(test_file) def test_archive_gz(self): test_file = self.get_test_loc('contenttype/archive/file_4.26-1.diff.gz') @@ -181,6 +193,7 @@ def test_archive_gz(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) @skipIf(on_windows, 'fails because of libmagic bug on windows.') def test_archive_squashfs_crashing(self): @@ -189,6 +202,7 @@ def test_archive_squashfs_crashing(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) @skipIf(on_windows, 'fails because of libmagic bug on windows.') def test_archive_squashfs_gz(self): @@ -197,6 +211,7 @@ def test_archive_squashfs_gz(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) @skipIf(on_windows, 'fails because of libmagic bug on windows.') def test_archive_squashfs_lzo(self): @@ -205,6 +220,7 @@ def test_archive_squashfs_lzo(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) @skipIf(on_windows, 'fails because of libmagic bug on windows.') def test_archive_squashfs_xz(self): @@ -213,6 +229,7 @@ def test_archive_squashfs_xz(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_archive_tar_bz2(self): test_file = self.get_test_loc('contenttype/archive/e.tar.bz2') @@ -221,6 +238,7 @@ def test_archive_tar_bz2(self): assert 'bzip2 compressed data, block size = 900k' == get_filetype(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_archive_tar_gz_1(self): test_file = self.get_test_loc('contenttype/archive/a.tar.gz') @@ -232,6 +250,7 @@ def test_archive_tar_gz_1(self): assert is_archive(test_file) assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_archive_tar_gz_3(self): test_file = self.get_test_loc('contenttype/archive/e.tar.gz') @@ -240,6 +259,7 @@ def test_archive_tar_gz_3(self): assert get_filetype(test_file).startswith('gzip compressed data') assert is_compressed(test_file) assert not contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_archive_tar_posix_not_compressed(self): test_file = self.get_test_loc('contenttype/archive/posixnotgnu.tar') @@ -248,6 +268,7 @@ def test_archive_tar_posix_not_compressed(self): assert 'posix tar archive' == get_filetype(test_file) assert not is_compressed(test_file) assert contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_ar_archive_win_library(self): test_file = self.get_test_loc('contenttype/archive/win-archive.lib') @@ -256,6 +277,7 @@ def test_ar_archive_win_library(self): assert 'current ar archive' == get_filetype(test_file) assert not is_compressed(test_file) assert contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_win_dll(self): test_file = self.get_test_loc('contenttype/binary/windows.dll') @@ -263,26 +285,31 @@ def test_win_dll(self): assert not is_archive(test_file) assert not is_compressed(test_file) assert contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_config_eclipse_data(self): test_file = self.get_test_loc('contenttype/config/eclipse_configuration_3u.cfs') assert is_binary(test_file) assert 'data' == get_filetype(test_file) assert contains_text(test_file) + assert '' == get_filetype_pygment(test_file) def test_binary_data(self): test_file = self.get_test_loc('contenttype/binary/data.fdt') assert is_binary(test_file) assert 'data' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_binary_data_2(self): test_file = self.get_test_loc('contenttype/binary/dbase.fdt') assert 'data' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_binary_java_serialized_data(self): test_file = self.get_test_loc('contenttype/binary/jruby_time_zone_TimeOfDay.dat') assert is_binary(test_file) assert 'java serialization data, version 5' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_binary_random_data(self): assert 'data' == get_filetype(self.get_test_loc('contenttype/binary-random/binary_random_0')) @@ -294,73 +321,87 @@ def test_binary_random_data(self): assert 'data' == get_filetype(self.get_test_loc('contenttype/binary-random/binary_random_6')) assert 'data' == get_filetype(self.get_test_loc('contenttype/binary-random/binary_random_7')) assert 'data' == get_filetype(self.get_test_loc('contenttype/binary-random/binary_random_8')) + assert '' == get_filetype_pygment(self.get_test_loc('contenttype/binary-random/binary_random_8')) def test_build_ant_build_xml(self): test_file = self.get_test_loc('contenttype/build/build.xml') assert not is_binary(test_file) - assert 'xml language text' == get_filetype(test_file) + assert 'exported sgml document, ascii text, with crlf line terminators' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) + assert is_text(test_file) + assert not is_source(test_file) + assert not is_script(test_file) def test_build_makefile(self): test_file = self.get_test_loc('contenttype/build/Makefile') - assert is_source(test_file) + assert not is_source(test_file) + assert not is_script(test_file) assert is_text(test_file) - assert 'Makefile' == get_filetype_pygment(test_file) + assert '' == get_filetype_pygment(test_file) assert 'ASCII text' == get_filetype_file(test_file) - assert 'makefile language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) assert 'text/plain' == get_mimetype_file(test_file) def test_build_makefile_2(self): test_file = self.get_test_loc('contenttype/build/Makefile.inc') - assert is_source(test_file) assert is_text(test_file) + assert '' == get_filetype_pygment(test_file) + assert 'makefile script, ascii text, with crlf line terminators' == get_filetype(test_file) assert 'text/x-makefile' == get_mimetype_file(test_file) assert 'makefile script, ASCII text, with CRLF line terminators' == get_filetype_file(test_file) - - @expectedFailure - def test_build_makefile_inc_is_not_povray(self): - test_file = self.get_test_loc('contenttype/build/Makefile.inc') - assert 'Makefile' == get_filetype_pygment(test_file) - assert 'makefile language text' == get_filetype(test_file) + assert not is_source(test_file) def test_build_ide_makefile(self): test_file = self.get_test_loc('contenttype/build/documentation.dsp') - assert 'makefile language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) + assert not is_source(test_file) def test_build_java_maven_pom_pom(self): test_file = self.get_test_loc('contenttype/build/pom.pom') + assert '' == get_filetype_pygment(test_file) + assert 'xml document text' == get_filetype(test_file) assert not is_source(test_file) def test_build_java_maven_pom_xml(self): test_file = self.get_test_loc('contenttype/build/pom.xml') - assert is_source(test_file) - assert 'xml language text' == get_filetype(test_file) + assert not is_source(test_file) + assert 'exported sgml document, ascii text' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_certificate_rsa_eclipse(self): test_file = self.get_test_loc('contenttype/certificate/ECLIPSE.RSA') assert is_binary(test_file) assert 'data' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_certificate(self): test_file = self.get_test_loc('contenttype/certificate/CERTIFICATE') assert is_binary(test_file) assert 'data' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_code_assembly(self): test_file = self.get_test_loc('contenttype/code/assembly/bcopy.s') assert 'C source, ASCII text, with CRLF line terminators' == get_filetype_file(test_file) assert 'GAS' == get_filetype_pygment(test_file) assert 'text/x-c' == get_mimetype_file(test_file) + assert is_source(test_file) + assert is_text(test_file) def test_code_c_1(self): test_file = self.get_test_loc('contenttype/code/c/c_code.c') - assert 'c language text' == get_filetype(test_file) + assert 'ti-xx graphing calculator (flash)' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) + assert is_source(test_file) + assert is_text(test_file) def test_code_c_2(self): test_file = self.get_test_loc('contenttype/code/c/main.c') assert is_source(test_file) assert is_text(test_file) - assert 'C' == get_filetype_pygment(test_file) - assert 'c language text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) + assert 'c source, ascii text' == get_filetype(test_file) assert 'C source, ASCII text' == get_filetype_file(test_file) assert 'text/x-c' == get_mimetype_file(test_file) @@ -368,16 +409,16 @@ def test_code_c_3(self): test_file = self.get_test_loc('contenttype/code/c/cpu.c') assert is_source(test_file) assert is_text(test_file) - assert 'C' == get_filetype_pygment(test_file) - assert 'c language text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) + assert 'c source, ascii text' == get_filetype(test_file) assert 'text/x-c' == get_mimetype_file(test_file) def test_code_c_4(self): test_file = self.get_test_loc('contenttype/code/c/mm.c') assert is_source(test_file) assert is_text(test_file) - assert 'C' == get_filetype_pygment(test_file) - assert 'c language text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) + assert 'c source, ascii text' == get_filetype(test_file) assert 'text/x-c' == get_mimetype_file(test_file) def test_code_c_5(self): @@ -385,8 +426,8 @@ def test_code_c_5(self): assert is_source(test_file) assert is_text(test_file) assert 'C source, ASCII text' == get_filetype_file(test_file) - assert 'C' == get_filetype_pygment(test_file) - assert 'c language text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) + assert 'c source, ascii text' == get_filetype(test_file) assert 'text/x-c' == get_mimetype_file(test_file) def test_code_c_6(self): @@ -394,46 +435,59 @@ def test_code_c_6(self): assert is_source(test_file) assert is_text(test_file) assert 'C source, ASCII text' == get_filetype_file(test_file) - assert 'C' == get_filetype_pygment(test_file) - assert 'c language text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) + assert 'c source, ascii text' == get_filetype(test_file) assert 'text/x-c' == get_mimetype_file(test_file) def test_code_c_7(self): test_file = self.get_test_loc('contenttype/code/c/some.c') - assert 'c language text' == get_filetype(test_file) + assert 'ti-xx graphing calculator (flash)' == get_filetype(test_file) + assert is_source(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_c_include(self): test_file = self.get_test_loc('contenttype/code/c/resource.h') - assert 'c language text' == get_filetype(test_file) + assert 'ascii text, with crlf line terminators' == get_filetype(test_file) assert is_source(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_c_include_2(self): test_file = self.get_test_loc('contenttype/code/c/netdb.h') - assert 'c language text' == get_filetype(test_file) + assert 'very short file (no magic)' == get_filetype(test_file) assert is_source(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_c_include_mixed_case_2(self): test_file = self.get_test_loc('contenttype/code/c/TEST_LOWERCASE.h') - assert 'c language text' == get_filetype(test_file) + assert 'c source, ascii text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_cpp_include_mixed_case(self): test_file = self.get_test_loc('contenttype/code/c/TEST.H') - assert 'c++ language text' == get_filetype(test_file) + assert 'c source, ascii text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_cpp_mixed_case(self): test_file = self.get_test_loc('contenttype/code/c/SIMPLE.C') - assert 'c++ language text' == get_filetype(test_file) + assert 'c source, ascii text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_cpp_mixed_case_2(self): test_file = self.get_test_loc('contenttype/code/cpp/string.CPP') - assert 'c++ language text' == get_filetype(test_file) + + expected = 'c source, ascii text' + if on_mac: + expected = 'c++ source, ascii text' + + assert expected == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) def test_code_cpp_1(self): test_file = self.get_test_loc('contenttype/code/cpp/stacktrace.cpp') assert is_source(test_file) assert is_text(test_file) assert 'C++' == get_filetype_pygment(test_file) - assert 'c++ language text' == get_filetype(test_file) + assert 'c source, ascii text' == get_filetype(test_file) assert 'text/x-c' == get_mimetype_file(test_file) def test_code_cpp_non_ascii(self): @@ -442,29 +496,30 @@ def test_code_cpp_non_ascii(self): assert is_text(test_file) assert 'application/octet-stream' == get_mimetype_file(test_file) assert 'C++' == get_filetype_pygment(test_file) - assert 'c++ language text' == get_filetype(test_file) + assert 'data' == get_filetype(test_file) def test_code_cpp_stdafx(self): test_file = self.get_test_loc('contenttype/code/cpp/StdAfx.cpp') - assert 'c++ language text' == get_filetype(test_file) + assert 'c source, ascii text' == get_filetype(test_file) + assert 'C++' == get_filetype_pygment(test_file) - @expectedFailure def test_code_groff(self): test_file = self.get_test_loc(u'contenttype/code/groff/example.ms') assert not is_special(test_file) assert is_text(test_file) - assert 'Groff' == get_filetype_pygment(test_file) - assert 'groff language text' == get_filetype(test_file) + assert 'troff or preprocessor input, ascii text' == get_filetype(test_file) + assert 'GAS' == get_filetype_pygment(test_file) # the Apache mimes do not have .ms in their types # but the type is still mysteriously returnedd on Windows - assert '' == get_mimetype_python(test_file) + assert 'text/troff' == get_mimetype_python(test_file) assert 'text/troff' == get_mimetype_file(test_file) assert get_filetype_file(test_file).startswith('troff or preprocessor input') def test_code_java_1(self): test_file = self.get_test_loc('contenttype/code/java/contenttype.java') assert not is_binary(test_file) - assert 'Java' == get_pygments_lexer(test_file).name + assert 'ascii text' == get_filetype(test_file) + assert 'Java' == get_filetype_pygment(test_file) def test_code_java_non_ascii(self): test_file = self.get_test_loc('contenttype/code/java/ChartTiming1.java') @@ -472,61 +527,72 @@ def test_code_java_non_ascii(self): assert is_text(test_file) # FIXME: incorrect assert 'application/octet-stream' == get_mimetype_file(test_file) + assert 'data' == get_filetype(test_file) assert 'Java' == get_filetype_pygment(test_file) - assert 'java language text' == get_filetype(test_file) def test_code_java_3(self): test_file = self.get_test_loc('contenttype/code/java/Appender.java') - assert 'java language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) + assert 'Java' == get_filetype_pygment(test_file) def test_code_java_jad(self): - # FIXME: should this be Java code? test_file = self.get_test_loc('contenttype/code/java/CommonViewerSiteFactory.jad') - assert 'python language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) + # FIXME: should this be Java code? + assert 'Python' == get_filetype_pygment(test_file) def test_code_java_mixed_case(self): - # FIXME: incorrect type test_file = self.get_test_loc('contenttype/code/java/Logger.JAVA') - assert 'python language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) + assert 'Java' == get_filetype_pygment(test_file) def test_code_js(self): - assert not is_media(self.get_test_loc('contenttype/code/js/a.js')) + test_file = self.get_test_loc('contenttype/code/js/a.js') + assert not is_media(test_file) + assert 'ascii text, with crlf line terminators' == get_filetype(test_file) + assert 'JavaScript' == get_filetype_pygment(test_file) def test_code_python_1(self): test_file = self.get_test_loc('contenttype/code/python/contenttype.py') assert not is_binary(test_file) assert 'Python' == get_pygments_lexer(test_file).name + assert 'Python' == get_filetype_pygment(test_file) def test_code_python_2(self): test_file = self.get_test_loc('contenttype/code/python/extract.py') assert is_source(test_file) assert is_text(test_file) assert 'Python' == get_filetype_pygment(test_file) - assert 'python language text' == get_filetype(test_file) + assert 'python script, ascii text executable' == get_filetype(test_file) assert 'text/x-python' == get_mimetype_file(test_file) assert get_filetype_file(test_file).startswith('Python script') def test_code_python_3(self): test_file = self.get_test_loc('contenttype/code/python/__init__.py') - assert 'python language text' == get_filetype(test_file) + assert 'python script, ascii text executable' == get_filetype(test_file) + assert 'Python' == get_filetype_pygment(test_file) def test_code_resource(self): test_file = self.get_test_loc('contenttype/code/c/CcccDevStudioAddIn.rc2') - assert 'c language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) + assert 'C' == get_filetype_pygment(test_file) def test_code_scala(self): test_file = self.get_test_loc('contenttype/code/scala/Applicative.scala') - assert 'scala language text' == get_filetype(test_file) + assert 'utf-8 unicode text' == get_filetype(test_file) + assert 'Scala' == get_filetype_pygment(test_file) def test_compiled_elf_exe_32bits(self): test_file = self.get_test_loc('contenttype/compiled/linux/i686-shash') assert is_binary(test_file) assert 'elf 32-bit lsb executable, intel 80386, version 1 (sysv), dynamically linked, interpreter /lib/ld-linux.so.2, for gnu/linux 2.6.4, not stripped' == get_filetype(self.get_test_loc(u'contenttype/compiled/linux/i686-shash')) + assert '' == get_filetype_pygment(test_file) def test_compiled_elf_exe_64bits(self): test_file = self.get_test_loc('contenttype/compiled/linux/x86_64-shash') assert is_binary(test_file) assert 'elf 64-bit lsb executable, x86-64, version 1 (sysv), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for gnu/linux 2.6.9, not stripped' == get_filetype(self.get_test_loc(u'contenttype/compiled/linux/x86_64-shash')) + assert '' == get_filetype_pygment(test_file) def test_compiled_elf_so(self): test_file = self.get_test_loc(u'contenttype/compiled/linux/libssl.so.0.9.7') @@ -536,35 +602,42 @@ def test_compiled_elf_so(self): assert 'application/x-sharedlib' == get_mimetype_file(test_file) assert 'elf 32-bit lsb shared object, intel 80386, version 1 (sysv), dynamically linked, stripped' == get_filetype(test_file) assert 'ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped' == get_filetype_file(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_elf_so_2(self): test_file = self.get_test_loc('contenttype/compiled/linux/libnetsnmpagent.so.5') assert not is_source(test_file) assert 'elf 32-bit lsb shared object, intel 80386, version 1 (sysv), dynamically linked, not stripped' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_flash(self): test_file = self.get_test_loc('contenttype/compiled/flash/a.swf') assert is_binary(test_file) assert 'macromedia flash data, version 7' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_flash_2(self): test_file = self.get_test_loc('contenttype/compiled/flash/b.swf') assert is_binary(test_file) assert 'macromedia flash data, version 7' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_flash_swc(self): test_file = self.get_test_loc('contenttype/compiled/flash/flash-haloclassic.swc.incr') assert is_binary(test_file) assert 'data' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_java_classfile_1(self): test_file = self.get_test_loc('contenttype/compiled/java/CommonViewerSiteFactory.class') assert 'compiled java class data, version 46.0 (java 1.2)' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_java_classfile_2(self): test_file = self.get_test_loc('contenttype/compiled/java/old.class') assert is_binary(test_file) assert 'compiled java class data, version 46.0 (java 1.2)' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_compiled_python_1(self): test_dir = self.extract_test_zip('contenttype/compiled/python/compiled.zip') @@ -594,15 +667,18 @@ def test_compiled_win_dll(self): test_file = self.get_test_loc(u'contenttype/compiled/win/zlib1.dll') assert is_winexe(test_file) assert is_binary(self.get_test_loc('contenttype/compiled/win/zlib1.dll')) + assert '' == get_filetype_pygment(test_file) def test_compiled_win_exe(self): test_file = self.get_test_loc(u'contenttype/compiled/win/file.exe') assert is_winexe(test_file) assert is_binary(self.get_test_loc('contenttype/compiled/win/file.exe')) + assert '' == get_filetype_pygment(test_file) def test_config_conf(self): test_file = self.get_test_loc('contenttype/config/config.conf') assert 'ascii text, with crlf line terminators' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_config_linux_conf(self): test_file = self.get_test_loc('contenttype/config/defconfig-ar531x-jffs2') @@ -617,11 +693,13 @@ def test_config_text_3(self): test_file = self.get_test_loc('contenttype/config/wrapper.conf') assert 'ascii text, with crlf line terminators' == get_filetype(test_file) assert 'ascii text, with crlf line terminators' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_debug_win_pdb(self): test_file = self.get_test_loc('contenttype/debug/QTMovieWin.pdb') assert is_binary(test_file) assert 'msvc program database ver \\004' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_doc_html(self): test_file = self.get_test_loc('contenttype/doc/html/contenttype.html') @@ -633,7 +711,7 @@ def test_doc_html_2(self): assert is_source(test_file) assert is_text(test_file) assert 'HTML' == get_filetype_pygment(test_file) - assert 'html language text' == get_filetype(test_file) + assert 'html document, ascii text' == get_filetype(test_file) assert 'text/html' == get_mimetype_file(test_file) assert 'HTML document, ASCII text' == get_filetype_file(test_file) @@ -642,7 +720,7 @@ def test_doc_html_3(self): assert is_source(test_file) assert is_text(test_file) assert 'HTML' == get_filetype_pygment(test_file) - assert 'html language text' == get_filetype(test_file) + assert 'html document, ascii text, with very long lines' == get_filetype(test_file) assert 'text/html' == get_mimetype_file(test_file) assert 'HTML document, ASCII text, with very long lines' == get_filetype_file(test_file) @@ -748,17 +826,17 @@ def test_doc_postscript_eps(self): def test_doc_xml(self): test_file = self.get_test_loc('contenttype/doc/xml/simple.xml') assert not is_binary(test_file) - assert 'xml language text' == get_filetype(test_file) + assert 'ascii text' == get_filetype(test_file) def test_doc_xml_2(self): test_file = self.get_test_loc('contenttype/doc/xml/some.xml') assert not is_binary(test_file) - assert 'xml language text' == get_filetype(test_file) + assert 'xml document text' == get_filetype(test_file) def test_doc_xml_3(self): test_file = self.get_test_loc('contenttype/doc/xml/somespring.xml') assert not is_binary(test_file) - assert 'xml language text' == get_filetype(test_file) + assert 'xml document text' == get_filetype(test_file) def test_media_audio_aif(self): test_file = self.get_test_loc('contenttype/media/a.aif') @@ -890,6 +968,8 @@ def test_media_image_svg(self): test_file = self.get_test_loc('contenttype/media/drawing.svg') assert not is_binary(test_file) assert is_media(test_file) + assert '' == get_filetype_pygment(test_file) + assert 'SVG Scalable Vector Graphics image' == get_filetype_file(test_file) assert not is_source(test_file) def test_media_image_tgg(self): @@ -1022,22 +1102,28 @@ def test_package_rubygem(self): def test_script_bash(self): test_file = self.get_test_loc('contenttype/script/test.sh') - assert 'bash language text' == get_filetype(test_file) + assert 'posix shell script, ascii text executable' == get_filetype(test_file) + assert 'Bash' == get_filetype_pygment(test_file) def test_script_bash_makelinks(self): test_file = self.get_test_loc('contenttype/script/makelinks') assert is_source(test_file) + assert 'Bash' == get_filetype_pygment(test_file) def test_script_windows_bat(self): test_file = self.get_test_loc('contenttype/script/build_w32vc.bat') - assert 'batchfile language text' == get_filetype(test_file) + assert 'dos batch file, ascii text' == get_filetype(test_file) + assert 'Batchfile' == get_filetype_pygment(test_file) def test_script_windows_bat_2(self): test_file = self.get_test_loc('contenttype/script/zip_src.bat') - assert 'batchfile language text' == get_filetype(test_file) + assert 'ascii text, with crlf line terminators' == get_filetype(test_file) + assert 'Batchfile' == get_filetype_pygment(test_file) def test_script_install(self): - assert 'ascii text' == get_filetype(self.get_test_loc('contenttype/script/install')) + test_file = self.get_test_loc('contenttype/script/install') + assert 'ascii text' == get_filetype(test_file) + assert '' == get_filetype_pygment(test_file) def test_text_crashing(self): # these used to make libmagic crash somehow @@ -1045,11 +1131,13 @@ def test_text_crashing(self): assert 'ASCII text' == get_filetype_file(test_file) test_file = self.get_test_loc('contenttype/text/crashing-z.txt') assert 'ASCII text' == get_filetype_file(test_file) + assert '' == get_filetype_pygment(test_file) def test_text(self): test_file = self.get_test_loc('contenttype/text/x11-xconsortium_text.txt') assert not is_binary(test_file) assert not is_archive(test_file) + assert '' == get_filetype_pygment(test_file) def test_text_license_copying(self): test_file = self.get_test_loc('contenttype/text/COPYING') @@ -1062,18 +1150,17 @@ def test_text_license_copying(self): def test_text_license_credits(self): # FIXME test_file = self.get_test_loc('contenttype/text/CREDITS') - assert 'css+lasso language text' == get_filetype(test_file) + assert 'iso-8859 text' == get_filetype(test_file) assert is_text(test_file) - # FIXME: incorrect - assert is_source(test_file) - # FIXME: incorrect - assert 'CSS+Lasso' == get_filetype_pygment(test_file) + assert not is_source(test_file) + assert '' == get_filetype_pygment(test_file) assert 'ISO-8859 text' == get_filetype_file(test_file) assert 'text/plain' == get_mimetype_file(test_file) def test_text_license_gpl(self): test_file = self.get_test_loc('contenttype/text/GPL.txt') assert not is_source(test_file) + assert '' == get_filetype_pygment(test_file) def test_text_log(self): test_file = self.get_test_loc('contenttype/text/windowserver.log') @@ -1083,6 +1170,7 @@ def test_text_log(self): assert 'ascii text' == get_filetype(test_file) assert 'ASCII text' == get_filetype_file(test_file) assert 'text/plain' == get_mimetype_file(test_file) + assert '' == get_filetype_pygment(test_file) def test_is_standard_include(self): assert is_standard_include('') @@ -1092,6 +1180,7 @@ def test_is_standard_include(self): def test_text_iso_text_changelog_is_not_iso_cdrom(self): test_file = self.get_test_loc('contenttype/text/ChangeLog') assert 'Non-ISO extended-ASCII text' == get_filetype_file(test_file) + assert '' == get_filetype_pygment(test_file) @expectedFailure def test_text_rsync_file_is_not_octet_stream(self): @@ -1110,19 +1199,24 @@ def test_rgb_stream_is_binary(self): def test_large_text_file_is_data(self): test_file = self.get_test_loc('contenttype/data/nulls.txt') assert is_data(test_file) + assert '' == get_filetype_pygment(test_file) def test_is_js_map_for_css(self): test_file = self.get_test_loc('contenttype/build/ar-ER.css.map') assert is_js_map(test_file) + assert '' == get_filetype_pygment(test_file) def test_is_js_map_for_js(self): test_file = self.get_test_loc('contenttype/build/ar-ER.js.map') assert is_js_map(test_file) + assert '' == get_filetype_pygment(test_file) def test_test_is_js_map_for_binary(self): test_file = self.get_test_loc('contenttype/build/binary.js.map') assert not is_js_map(test_file) + assert '' == get_filetype_pygment(test_file) def test_test_is_js_map_for_makefile(self): test_file = self.get_test_loc('contenttype/build/Makefile') assert not is_js_map(test_file) + assert '' == get_filetype_pygment(test_file) diff --git a/thirdparty/prod/Pygments-2.0.1-py2-none-any.whl b/thirdparty/prod/Pygments-2.0.1-py2-none-any.whl deleted file mode 100644 index 73e1b1f5b34..00000000000 Binary files a/thirdparty/prod/Pygments-2.0.1-py2-none-any.whl and /dev/null differ diff --git a/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl b/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl new file mode 100644 index 00000000000..d9075309d30 Binary files /dev/null and b/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl differ diff --git a/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl.ABOUT b/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl.ABOUT new file mode 100644 index 00000000000..1889281b54a --- /dev/null +++ b/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl.ABOUT @@ -0,0 +1,28 @@ +about_resource: Pygments-2.2.0-py2.py3-none-any.whl +attribute: true +checksum_md5: ce67fc58b51ffd29a2de8b97fcda274a +checksum_sha1: 18dd2c8aa095be731733771e9bdef04e5e3b9436 +contact: georg@python.org +copyright: Copyright by the Pygments team +description: Pygments is a generic syntax highlighter suitable for use in code hosting, + forums, wikis or other applications that need to prettify source code. +download_url: https://pypi.python.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl#md5=ce67fc58b51ffd29a2de8b97fcda274a +homepage_url: http://pygments.org/ +license_expression: bsd-simplified AND apache-2.0 +licenses: +- file: apache-2.0.LICENSE + key: apache-2.0 + name: Apache License 2.0 +- file: bsd-simplified.LICENSE + key: bsd-simplified + name: BSD-2-Clause +name: Pygments +notice_file: Pygments-2.2.0-py2.py3-none-any.whl.NOTICE +notice_url: https://bitbucket.org/birkenfeld/pygments-main/src/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/LICENSE?at=default&fileviewer=file-view-default +owner: Pocoo Team +owner_url: http://www.pocoo.org/ +track_changes: true +vcs_repository: http://bitbucket.org/birkenfeld/pygments-main +version: 2.2.0 + +vcs_tool: hg diff --git a/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl.NOTICE b/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl.NOTICE new file mode 100644 index 00000000000..a369ccea003 --- /dev/null +++ b/thirdparty/prod/Pygments-2.2.0-py2.py3-none-any.whl.NOTICE @@ -0,0 +1,40 @@ +Copyright (c) 2006-2017 by the respective authors (see AUTHORS file). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# Copyright 2012 Nokia Siemens Networks Oyj +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. \ No newline at end of file diff --git a/thirdparty/prod/pygments.ABOUT b/thirdparty/prod/pygments.ABOUT deleted file mode 100644 index b643ba21946..00000000000 --- a/thirdparty/prod/pygments.ABOUT +++ /dev/null @@ -1,12 +0,0 @@ -about_resource: Pygments-2.0.1-py2-none-any.whl -download_url: http://pypi.python.org/packages/source/P/Pygments/Pygments-1.0.tar.gz -name: Pygments -version: 2.0.1 -copyright: Copyright (c) 2006-2011 by the respective authors (see AUTHORS file) -homepage_url: http://pygments.org/ - -license_expression: bsd-new -license_file: pygments.LICENSE - -vcs_tool: hg -vcs_repository:https://bitbucket.org/birkenfeld/pygments-main \ No newline at end of file diff --git a/thirdparty/prod/pygments.AUTHORS b/thirdparty/prod/pygments.AUTHORS deleted file mode 100644 index 83bbee57b4e..00000000000 --- a/thirdparty/prod/pygments.AUTHORS +++ /dev/null @@ -1,114 +0,0 @@ -Pygments is written and maintained by Georg Brandl . - -Major developers are Tim Hatch and Armin Ronacher -. - -Other contributors, listed alphabetically, are: - -* Sam Aaron -- Ioke lexer -* Kumar Appaiah -- Debian control lexer -* Ali Afshar -- image formatter -* Andreas Amann -- AppleScript lexer -* Jeremy Ashkenas -- CoffeeScript lexer -* Stefan Matthias Aust -- Smalltalk lexer -* Ben Bangert -- Mako lexers -* Max Battcher -- Darcs patch lexer -* Paul Baumgart, 280 North, Inc. -- Objective-J lexer -* Michael Bayer -- Myghty lexers -* John Benediktsson -- Factor lexer -* Christopher Bertels -- Fancy lexer -* Jarrett Billingsley -- MiniD lexer -* Adam Blinkinsop -- Haskell, Redcode lexers -* Frits van Bommel -- assembler lexers -* Pierre Bourdon -- bugfixes -* Hiram Chirino -- Scaml and Jade lexers -* Leaf Corcoran -- MoonScript lexer -* Christopher Creutzig -- MuPAD lexer -* Pete Curry -- bugfixes -* Owen Durni -- haXe lexer -* Nick Efford -- Python 3 lexer -* Artem Egorkine -- terminal256 formatter -* James H. Fisher -- PostScript lexer -* Carlos Galdino -- Elixir and Elixir Console lexers -* Naveen Garg -- Autohotkey lexer -* Laurent Gautier -- R/S lexer -* Alex Gaynor -- PyPy log lexer -* Bertrand Goetzmann -- Groovy lexer -* Krzysiek Goj -- Scala lexer -* Matt Good -- Genshi, Cheetah lexers -* Patrick Gotthardt -- PHP namespaces support -* Olivier Guibe -- Asymptote lexer -* Martin Harriman -- SNOBOL lexer -* Matthew Harrison -- SVG formatter -* Steven Hazel -- Tcl lexer -* Aslak Hellesøy -- Gherkin lexer -* Jordi Gutiérrez Hermoso -- Octave lexer -* David Hess, Fish Software, Inc. -- Objective-J lexer -* Varun Hiremath -- Debian control lexer -* Ben Hollis -- Mason lexer -* Tim Howard -- BlitzMax lexer -* Ivan Inozemtsev -- Fantom lexer -* Brian R. Jackson -- Tea lexer -* Dennis Kaarsemaker -- sources.list lexer -* Igor Kalnitsky -- vhdl lexer -* Adam Koprowski -- Opa lexer -* Benjamin Kowarsch -- Modula-2 lexer -* Marek Kubica -- Scheme lexer -* Jochen Kupperschmidt -- Markdown processor -* Gerd Kurzbach -- Modelica lexer -* Olov Lassus -- Dart lexer -* Sylvestre Ledru -- Scilab lexer -* Mark Lee -- Vala lexer -* Ben Mabey -- Gherkin lexer -* Simone Margaritelli -- Hybris lexer -* Kirk McDonald -- D lexer -* Gordon McGregor -- SystemVerilog lexer -* Stephen McKamey -- Duel/JBST lexer -* Brian McKenna -- F# lexer -* Lukas Meuser -- BBCode formatter, Lua lexer -* Hong Minhee -- HTTP lexer -* Michael Mior -- Awk lexer -* Paulo Moura -- Logtalk lexer -* Mher Movsisyan -- DTD lexer -* Ana Nelson -- Ragel, ANTLR, R console lexers -* Nam T. Nguyen -- Monokai style -* Jesper Noehr -- HTML formatter "anchorlinenos" -* Jonas Obrist -- BBCode lexer -* David Oliva -- Rebol lexer -* Jon Parise -- Protocol buffers lexer -* Ronny Pfannschmidt -- BBCode lexer -* Benjamin Peterson -- Test suite refactoring -* Dominik Picheta -- Nimrod lexer -* Clément Prévost -- UrbiScript lexer -* Justin Reidy -- MXML lexer -* Norman Richards -- JSON lexer -* Lubomir Rintel -- GoodData MAQL and CL lexers -* Andre Roberge -- Tango style -* Konrad Rudolph -- LaTeX formatter enhancements -* Mario Ruggier -- Evoque lexers -* Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers -* Matteo Sasso -- Common Lisp lexer -* Joe Schafer -- Ada lexer -* Ken Schutte -- Matlab lexers -* Tassilo Schweyer -- Io, MOOCode lexers -* Joerg Sieker -- ABAP lexer -* Robert Simmons -- Standard ML lexer -* Kirill Simonov -- YAML lexer -* Steve Spigarelli -- XQuery lexer -* Jerome St-Louis -- eC lexer -* James Strachan -- Kotlin lexer -* Tiberius Teng -- default style overhaul -* Jeremy Thurgood -- Erlang, Squid config lexers -* Erick Tryzelaar -- Felix lexer -* Daniele Varrazzo -- PostgreSQL lexers -* Abe Voelker -- OpenEdge ABL lexer -* Whitney Young -- ObjectiveC lexer -* Matthias Vallentin -- Bro lexer -* Nathan Weizenbaum -- Haml and Sass lexers -* Dietmar Winkler -- Modelica lexer -* Nils Winter -- Smalltalk lexer -* Davy Wybiral -- Clojure lexer -* Diego Zamboni -- CFengine3 lexer -* Alex Zimin -- Nemerle lexer - -Many thanks for all contributions!