File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ RM ?= rm
1111PIP_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 \
Original file line number Diff line number Diff line change 2828The scanner and character tables are used inside `Mathics3 <https://mathics.org >`_. However information can
2929also 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
3232lexer and highlighter for Mathematica/Wolfram Language source code.
3333
3434This library may be useful if you need to work with the Wolfram Language
@@ -64,7 +64,8 @@ Implementation
6464--------------
6565
6666For 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
6970Contributing
7071------------
Original file line number Diff line number Diff line change 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
55As such, it also contains a full set of translation between Wolfram Language
66named characters, their Unicode/ASCII equivalents and code-points.
Original file line number Diff line number Diff line change 1313
1414# Silence warnings about JSON tables not existing
1515os .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 ])
1628from mathics_scanner .version import __version__ # noqa
1729
1830
Original file line number Diff line number Diff line change 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
55import json
1313
1414# Silence warnings about JSON tables not existing
1515os .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 ])
1628from mathics_scanner .version import __version__ # noqa
1729
1830
Original file line number Diff line number Diff line change 1515
1616# Silence warnings about JSON tables not existing
1717os .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+
1831from mathics_scanner .version import __version__ # noqa
1932
2033OPERATOR_FIELDS = [
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ full = [
5454mathics3-make-boxing-character-json = " mathics_scanner.generate.boxing_characters:main"
5555mathics3-make-named-character-json = " mathics_scanner.generate.named_characters:main"
5656mathics3-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 ]
6060packages = [
@@ -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" ,
Original file line number Diff line number Diff line change 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
66For the easiest installation just type the following command (you'll probably
77need 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
2813import os
You can’t perform that action at this time.
0 commit comments