Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
run: |
brew install asymptote
python3 -m pip install --upgrade pip
# Can comment out when next Mathics core and Mathics-scanner are released
# git clone https://github.com/Mathics3/mathics-scanner
# (cd mathics-scanner && pip install -e . && bash ./admin-tools/make-JSON-tables.sh)
# git clone https://github.com/Mathics3/mathics-core
# (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh && pip install -e .[full])
# We can comment out after next Mathics-Scanner release
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
bash -x admin-tools/make-JSON-tables.sh
cd ..
- name: Install mathicsscript
run: |
make
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ jobs:
run: |
sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev asymptote
python3 -m pip install --upgrade pip
# We can comment out when next Mathics core and Mathics-scanner are released
# git clone https://github.com/Mathics3/mathics-scanner
# (cd mathics-scanner && pip install -e . && bash ./admin-tools/make-JSON-tables.sh)
# git clone https://github.com/Mathics3/mathics-core
# (cd mathics-core && bash ./admin-tools/make-JSON-tables.sh && pip install -e .[full])
# We can comment out after next Mathics-Scanner release
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
bash -x admin-tools/make-JSON-tables.sh
cd ..
- name: Install mathicsscript
run: |
make
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install wheel
set LLVM_DIR="C:\Program Files\LLVM"
# We can comment out when next Mathics core and Mathics-scanner are released
# git clone https://github.com/Mathics3/mathics-scanner
# bash -c '(cd mathics-scanner && python -m pip install -e . && bash ./admin-tools/make-JSON-tables.sh)'
# git clone https://github.com/Mathics3/mathics-core
# bash -c '(cd mathics-core && ./admin-tools/make-JSON-tables.sh && python -m pip install -e .)'
# python -m pip install -e .
# We can comment out after next Mathics-Scanner release
python -m pip install -e "Mathics-Scanner[full] @ git+https://github.com/Mathics3/mathics-scanner"
pip install -e .
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
bash -x admin-tools/make-JSON-tables.sh
cd ..
- name: Install mathicsscript
run: |
make
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
exclude: ChangeLog-spell-corrected.diff
- id: end-of-file-fixer
exclude: ChangeLog-spell-corrected.diff
stages: [commit]
stages: [pre-commit]
- id: trailing-whitespace
exclude: ChangeLog-spell-corrected.diff
- repo: https://github.com/psf/black
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check: inputrc
inputrc: mathicsscript/data/inputrc-unicode mathicsscript/data/inputrc-no-unicode

mathicsscript/data/inputrc-unicode mathicsscript/data/inputrc-no-unicode mathicsscript/data/inputrc-unicode/mma-tables.json:
$(SHELL) ./admin-tools/make- @echo "# GNU Readline input unicode translations\n# Autogenerated from mathics_scanner.generate.rl_inputrc on $$(date)\n" > $@
$(SHELL) ./admin-tools/make-JSON-tables.sh

# Check StructuredText long description formatting
check-rst:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mydir=$(dirname $bs)
PYTHON=${PYTHON:-python}

cd $mydir/../mathicsscript/data
mathics3-generate-json-table --field=ascii-operators -o mma-tables.json
mathics3-make-named-character-json --field=ascii-operators -o mma-tables.json

for file in inputrc-unicode inputrc-no-unicode; do
echo "# GNU Readline input unicode translations" > $file
Expand Down
9 changes: 5 additions & 4 deletions mathicsscript/completion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2021-2022, 2024-2025 Rocky Bernstein <rb@dustyfeet.com>
# Copyright (C) 2021-2022, 2024-2026 Rocky Bernstein <rb@dustyfeet.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -21,8 +21,9 @@
from typing import Iterable, List, NamedTuple, Tuple

from mathics.core.symbols import strip_context
from mathics_scanner import named_characters
from mathics_pygments.lexer import Regex
from mathicsscript.settings import NAMED_CHARACTERS

from prompt_toolkit.completion import (
CompleteEvent,
Completer,
Expand Down Expand Up @@ -82,11 +83,11 @@ def get_completions(
yield Completion(cmd, -len(word))


class MathicsCompleter(WordCompleter):
class Mathics3Completer(WordCompleter):
def __init__(self, definitions):
self.definitions = definitions
self.completer = WordCompleter([])
self.named_characters = sorted(named_characters.keys())
self.named_characters = sorted(NAMED_CHARACTERS["named-characters"].keys())

# From WordCompleter, adjusted with default values
self.ignore_case = True
Expand Down
8 changes: 4 additions & 4 deletions mathicsscript/data/inputrc-no-unicode
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GNU Readline input unicode translations
# Autogenerated from mathics_scanner.generate.rl_inputrc on Wed Feb 12 11:52:14 AM EST 2025
# Autogenerated from mathics_scanner.generate.rl_inputrc on Sun Mar 1 03:40:19 PM EST 2026

"\ea'\e": "á"
"\ea-\e": "ā"
Expand All @@ -8,9 +8,9 @@
"\eae\e": "æ"
"\ea`\e": "à"
"\ea^\e": "â"
"\eal\e": "ℵ"
"\eao\e": "å"
"\ea~\e": "ã"
"\eal\e": "ℵ"
"\eesc\e": "\\[AliasIndicator]"
"\eam\e": "\\[AlignmentMarker]"
"\ea\e": "α"
Expand Down Expand Up @@ -146,7 +146,7 @@
"\ediffd\e": "∆"
"\edd\e": "𝑑"
"\edi\e": "ϝ"
"\ede\e": ""
"\ede\e": ""
"\edratio\e": "ϴ"
"\eshift\e": "\\[DiscreteShift]"
"\edhy\e": "\\[DiscretionaryHyphen]"
Expand Down Expand Up @@ -597,7 +597,7 @@
"\e]\e": "\\[RightModified]"
"\erT\e": "⊢"
"\evec\e": "⇀"
"\e->\e": ""
"\e->\e": ""
"\e:>\e": "⧴"
"\esv\e": "š"
"\esz\e": "ß"
Expand Down
8 changes: 4 additions & 4 deletions mathicsscript/data/inputrc-unicode
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GNU Readline input unicode translations
# Autogenerated from mathics_scanner.generate.rl_inputrc on Wed Feb 12 11:52:14 AM EST 2025
# Autogenerated from mathics_scanner.generate.rl_inputrc on Sun Mar 1 03:40:18 PM EST 2026

"\ea'\e": "á"
"\ea-\e": "ā"
Expand All @@ -8,9 +8,9 @@
"\eae\e": "æ"
"\ea`\e": "à"
"\ea^\e": "â"
"\eal\e": "ℵ"
"\eao\e": "å"
"\ea~\e": "ã"
"\eal\e": "ℵ"
"\eesc\e": "\\[AliasIndicator]"
"\eam\e": "\\[AlignmentMarker]"
"\ea\e": "α"
Expand Down Expand Up @@ -146,7 +146,7 @@
"\ediffd\e": "∆"
"\edd\e": "𝑑"
"\edi\e": "ϝ"
"\ede\e": ""
"\ede\e": ""
"\edratio\e": "ϴ"
"\eshift\e": "\\[DiscreteShift]"
"\edhy\e": "\\[DiscretionaryHyphen]"
Expand Down Expand Up @@ -597,7 +597,7 @@
"\e]\e": "\\[RightModified]"
"\erT\e": "⊢"
"\evec\e": "⇀"
"\e->\e": ""
"\e->\e": ""
"\e:>\e": "⧴"
"\esv\e": "š"
"\esz\e": "ß"
Expand Down
Loading