Commits

Thomas Aglassinger  committed 76d061e

Simplified adding and testing a new lexer by referring to the Makefile.

  • Participants
  • Parent commits 007ccf7

Comments (0)

Files changed (1)

File docs/src/lexerdevelopment.txt

 
     __all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
 
-Simply add the name of you lexer class to this list.
+Simply add the name of your lexer class to this list.
 
-Now update the ``python.lexers._mapping``. This is a generated module which
-can update itself by changing the current directory to its location and
-running it:
+Finally the lexer can be made publically known by rebuilding the lexer
+mapping:
 
 .. sourcecode:: console
 
-    $ cd pygments/lexers/
-    $ python _mapping.py
-    $ cd ../..
-
-Without the ``cd`` command, you will get an ``ImportError``:
-
-.. sourcecode:: pycon
-
-    ImportError: No module named ez_setup
+    $ make mapfiles
 
 To test the new lexer, store an example file with the proper extension in
 ``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
 
     $ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
 
-Note that we explicitely call the ``pygmentize`` in the current directory by
-preceding it with ``./``. This ensures your modifications are used.
+Note that this explicitely calls the ``pygmentize`` in the current directory
+by preceding it with ``./``. This ensures your modifications are used.
 Otherwise a possibly already installed, unmodified version without your new
 lexer would have been called from the system search path (``$PATH``).
 
 
 .. sourcecode:: console
 
-    $ python tests/run.py
+    $ make test
 
 
 Regex Flags