/pygments-factor

pygment's lexer for factor language syntax highlighting

Primary LanguagePython

Factor Syntax Lexer for Pygments

This Pygments lexer for Factor syntax highlighting has been contributed back and will be included in the agile languages lexer file /path/to/pygments/lexers/agile.py starting with Pygments version 1.4. This is where I will maintain the lexer and make future improvements to be contributed back. By all means, lend me a hand…the lexer could definitely be expanded, but basic support is there.

How to Use

If you’re running Pygments v1.4 or later, this lexer is included by default. If you’re using a previous version of Pygments or just want to use the most up-to-date Factor lexer from this page, you’ll want to add or update whatever exists in your agile languages file:

  1. Open up the the agile.py file contained in your Pygments installation’s /pygments/lexers/ directory and add/update the FactorLexer class with this code.
  2. Make sure that “FactorLexer” exists in the __all__ array at the top of the file.
  3. Save agile.py.
  4. To be safe, you’ll want to run the _mapping.py file from within the lexers/ directory so Pygments becomes aware of the additional lexer.
# cd /path/to/pygments/lexers/
# vim agile.py
# python ./_mapping.py

After that, Pygments will generate syntax highlighting for “factor” files.

License

Copyright © 2010, Aaron Bull Schaefer. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. 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.