diff --git a/CHANGES.rst b/CHANGES.rst index 0ab8b2f..32a92d9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,14 @@ CHANGES ======= +1.0.1 +----- + +* Fix RE's that I had messed up in initial port for Slots, Patterns and Named Characters +* Make ujson optional. This makes this runnable from pyston 2.2 + +Note: There are still a few tests from pygments-mathematica that fail. + 1.0.0 ----- diff --git a/README.md b/README.md index 867aa68..da2b89d 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,27 @@ [![mathics-pygments (OSX)](https://github.com/Mathics3/mathics-pygments/actions/workflows/osx.yaml/badge.svg)](https://github.com/Mathics3/mathics-pygments/actions/workflows/osx.yaml) [![mathics-pygments (ubuntu)](https://github.com/Mathics3/mathics-pygments/actions/workflows/ubuntu.yaml/badge.svg)](https://github.com/Mathics3/mathics-pygments/actions/workflows/ubuntu.yaml) +![](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square) +[![Packaging status](https://repology.org/badge/tiny-repos/mathics-pygments.svg)](https://repology.org/project/mathics-pygments/versions) + + A lexer and highlighter for [_Mathematica_](http://wolfram.com/mathematica)/Wolfram Language source code using the [pygments](http://pygments.org) engine. - This code is based on [pygments-mathematica](https://pypi.org/project/pygments-mathematica/) but has been specially revised so it interactis with [mathicsscript](https://pypi.org/project/mathicsscript/). As such it works better that pygments-mathematica for this use, and possibly might not be as good in other contexts. Over time though this should get address. + This code is based on [pygments-mathematica](https://pypi.org/project/pygments-mathematica/) but has been specially revised so it interacts with [mathicsscript](https://pypi.org/project/mathicsscript/). As such it works better that pygments-mathematica for this use, and possibly might not be as good in other contexts. Over time though this should get address. Another difference, is the fact that this package is relegate knowledge about operator names to [Mathics-Scanner](https://pypi.org/project/Mathics-Scanner/). -![](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square) + ## Features It can currently lex and highlight: - - All builtin functions in the ``System` `` context including unicode symbols like `π` except those - that use characters from the private unicode space (e.g. `\[FormalA]`). + - All builtin functions in the ``System` `` context including Unicode symbols like `π` except those + that use characters from the private Unicode space (e.g. `\[FormalA]`). - User defined symbols, including those in a context. - - All operators including unicode operators like `∈` and `⊕`. + - All operators including Unicode operators like `∈` and `⊕`. - Comments, including multi line and nested. - Strings, including multi line and escaped quotes. - Patterns, slots (including named slots `#name` introduced in version 10) and slot sequences. diff --git a/mathics_pygments/lexer.py b/mathics_pygments/lexer.py index de194f8..f8d94ab 100644 --- a/mathics_pygments/lexer.py +++ b/mathics_pygments/lexer.py @@ -13,7 +13,7 @@ class Regex: IDENTIFIER = r"[a-zA-Z\$][a-zA-Z0-9\$]*" - NAMED_CHARACTER = fr"\\\[{IDENTIFIER}]" + NAMED_CHARACTER = fr"\\\[{IDENTIFIER}\]" SYMBOLS = (fr'[`]?({IDENTIFIER}|{NAMED_CHARACTER})(`({IDENTIFIER}|{NAMED_CHARACTER}))*[`]?') INTEGER = r"[0-9]+" FLOAT = f"({INTEGER})?[.][0-9]+|{INTEGER}[.]" diff --git a/mathics_pygments/version.py b/mathics_pygments/version.py index c0fcf70..d79e7dd 100644 --- a/mathics_pygments/version.py +++ b/mathics_pygments/version.py @@ -4,4 +4,4 @@ # This file is suitable for sourcing inside POSIX shell as # well as importing into Python. That's why there is no # space around "=" below. -__version__="1.0.1.dev0" # noqa +__version__="1.0.1" # noqa