Skip to content

Commit

Permalink
Get ready for release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed May 23, 2021
1 parent 20ddfbb commit d06adaa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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
-----

Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mathics_pygments/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}[.]"
Expand Down
2 changes: 1 addition & 1 deletion mathics_pygments/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d06adaa

Please sign in to comment.