cannot used custom installed lexer · Issue #1172 · pygments/pygments · GitHub
Skip to content

cannot used custom installed lexer #1172

Open

Description

@Anteru

(Original issue 1468 created by lior_samuel on 2018-08-17T16:15:29.112642+00:00)

I created a simple lexer called domsaLex, and created a setup script to plug it into pygments.
the script runs without issues, and when I run

#!bash

pygmentize -L lexers

I can see my lexer in the list, but when I actually try to use it via

#!bash

pygmentize -l domsaLex

all I get is: Error: no lexer for alias 'domsaLex' found

below are my setup script and lexer class:

#!python

setup(
    name="domsagxo",
    packages=find_packages(),

     entry_points="""
         [pygments.lexers]
         domsaLex = syntax_high_light.pygment_lexer:domsaLex
         [pygments.styles]
         domsagxoStyle = syntax_high_light.pygment_style:DomsagxoStyle
     """
)

# in syntax_high_light/pygment_lexer.py

class domsaLex(RegexLexer):
    """All your lexer code goes here!"""
    name = "Domsagxo Keyword Lexer"
    aliases = ['domsaLex']
    filenames = ['*.domsa']
    tokens = {
        'root': [
            # some definitions...
        ]
    }

I am using the ubuntu subunit on windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-apiarea: changes to Pygments API or cmdlineT-bugtype: a bugX-importedimported from Bitbucketgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions