Skip to content

Commit e0c5239

Browse files
committed
Misc small changes since 10.0.0
1 parent b4fe870 commit e0c5239

8 files changed

Lines changed: 47 additions & 23 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RM ?= rm
1111
PIP_INSTALL_OPTS ?=
1212

1313
.PHONY: all build \
14+
ChangeLog-without-corrections \
1415
check check-full check-mathics3 clean \
1516
develop dist doc \
1617
inputrc-no-unicode \

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Uses
2828
The scanner and character tables are used inside `Mathics3 <https://mathics.org>`_. However information can
2929
also be used by other programs for tokenizing and formatting Wolfram Language code.
3030

31-
For example, tables are used in `mathics-pygments <https://pypi.org/project/Mathics-Scanner/>`_, a Pygments-based
31+
For example, tables are used in `mathics-pygments <https://pypi.org/project/Mathics3-pygments/>`_, a Pygments-based
3232
lexer and highlighter for Mathematica/Wolfram Language source code.
3333

3434
This library may be useful if you need to work with the Wolfram Language
@@ -64,7 +64,8 @@ Implementation
6464
--------------
6565

6666
For notes on the implementation of the packages or details on the conversion
67-
scheme, please read `Scanning <https:/https://mathics-development-guide.readthedocs.io/en/latest/code-overview/scanning.html>`_.
67+
scheme, please read `Mathics3 scanner's documentation <https://mathics3-scanner-and-yaml-tables-for-characters-and-operators.readthedocs.io/en/latest/>`_ or
68+
`Scanning section <https://mathics-development-guide.readthedocs.io/en/latest/code-overview/scanning.html>`_ of the Mathics3 User and Developers Guide.
6869

6970
Contributing
7071
------------

mathics_scanner/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
This is the tokeniser or scanner portion for the Wolfram Language.
3+
This is the tokenizer or scanner portion for the Wolfram Language.
44
55
As such, it also contains a full set of translation between Wolfram Language
66
named characters, their Unicode/ASCII equivalents and code-points.

mathics_scanner/generate/boxing_characters.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313

1414
# Silence warnings about JSON tables not existing
1515
os.environ["MATHICS3_TABLE_GENERATION"] = "true"
16+
try:
17+
from mathics_scanner.version import __version__ # noqa
18+
except ImportError:
19+
import ast
20+
from pathlib import Path
21+
22+
version_file = Path(__file__).parent.parent / "version.py"
23+
version_content = version_file.read_text()
24+
version_line = [
25+
line for line in version_content.split("\n") if line.startswith("__version__")
26+
][0]
27+
__version__ = ast.literal_eval(version_line.split("=")[1].strip().split("#")[0])
1628
from mathics_scanner.version import __version__ # noqa
1729

1830

mathics_scanner/generate/named_characters.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# This scripts reads the data from named-characters and converts it to the
2+
# This script reads the data from named-characters and converts it to the
33
# format used by the library internally
44

55
import json
@@ -13,6 +13,18 @@
1313

1414
# Silence warnings about JSON tables not existing
1515
os.environ["MATHICS3_TABLE_GENERATION"] = "true"
16+
17+
try:
18+
from mathics_scanner.version import __version__ # noqa
19+
except ImportError:
20+
import ast
21+
22+
version_file = Path(__file__).parent.parent / "version.py"
23+
version_content = version_file.read_text()
24+
version_line = [
25+
line for line in version_content.split("\n") if line.startswith("__version__")
26+
][0]
27+
__version__ = ast.literal_eval(version_line.split("=")[1].strip().split("#")[0])
1628
from mathics_scanner.version import __version__ # noqa
1729

1830

mathics_scanner/generate/operators.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515

1616
# Silence warnings about JSON tables not existing
1717
os.environ["MATHICS3_TABLE_GENERATION"] = "true"
18+
19+
try:
20+
from mathics_scanner.version import __version__ # noqa
21+
except ImportError:
22+
import ast
23+
24+
version_file = Path(__file__).parent.parent / "version.py"
25+
version_content = version_file.read_text()
26+
version_line = [
27+
line for line in version_content.split("\n") if line.startswith("__version__")
28+
][0]
29+
__version__ = ast.literal_eval(version_line.split("=")[1].strip().split("#")[0])
30+
1831
from mathics_scanner.version import __version__ # noqa
1932

2033
OPERATOR_FIELDS = [

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ full = [
5454
mathics3-make-boxing-character-json = "mathics_scanner.generate.boxing_characters:main"
5555
mathics3-make-named-character-json = "mathics_scanner.generate.named_characters:main"
5656
mathics3-make-operator-json = "mathics_scanner.generate.operators:main"
57-
mathics3-code-tokenize = "mathics_scanner.mathics3_code_tokenize:main"
57+
mathics3-codeparser-tokenize = "mathics_scanner.mathics3_code_tokenize:main"
5858

5959
[tool.setuptools]
6060
packages = [
@@ -67,7 +67,7 @@ packages = [
6767
"mathics_scanner" = [
6868
"data/boxing-characters.json",
6969
"data/boxing-characters.yml",
70-
"daa/grouping-characters.yml",
70+
"data/grouping-characters.yml",
7171
"data/named-characters.json",
7272
"data/named-characters.yml",
7373
"data/operators.yml",

setup.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
"""Setuptools based setup script for Mathics.
4+
"""Setuptools based setup script for Mathics3 Scanner.
55
66
For the easiest installation just type the following command (you'll probably
77
need root privileges):
88
9-
python setup.py install
9+
pip install -e .
1010
11-
This will install the library in the default location. For instructions on
12-
how to customize the install procedure read the output of:
13-
14-
python setup.py --help install
15-
16-
In addition, there are some other commands:
17-
18-
python setup.py clean -> will clean all trash (*.pyc and stuff)
19-
20-
To get a full list of available commands, read the output of:
21-
22-
python setup.py --help-commands
23-
24-
Or, if all else fails, feel free to write to the mathics users list at
25-
mathics-users@googlegroups.com and ask for help.
2611
"""
2712

2813
import os

0 commit comments

Comments
 (0)