Skip to content

Commit

Permalink
Scanner uses operators json mm (#89)
Browse files Browse the repository at this point in the history
* working out the initialization of the tokenizer
  • Loading branch information
mmatera authored Nov 25, 2024
1 parent ebe7baa commit c6d025a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions mathics_scanner/tokeniser.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def init_module():
("RawBackslash", r" \\ "),
("Factorial2", r" \!\! "),
("Factorial", r" \! "),
("Function", r" \& | \uF4A1 | \u21A6 | \|-> "),
("Function", r" \& | \uF4A1 | \u27FC | \|-> "),
("RawColon", r" \: "),
# ('DiscreteShift', r' \uf4a3 '),
# ('DiscreteRatio', r' \uf4a4 '),
Expand Down Expand Up @@ -365,12 +365,6 @@ def __repr__(self):
return f"Token({self.tag}, {self.text}, {self.pos})"


# FIXME: this should be done in Tokeniser so we can import
# this module from mathics_scanner and not worry about whether
# the operators.json has been created.
update_tokens_from_JSON()


class Tokeniser:
"""
This converts input strings from a feeder and
Expand All @@ -395,8 +389,6 @@ def __init__(self, feeder):
self.code = self.prescanner.replace_escape_sequences()
self.mode: str = "invalid"
self._change_token_scanning_mode("expr")
if tokens_need_JSON_update:
update_tokens_from_JSON()

def _change_token_scanning_mode(self, mode: str):
"""
Expand Down

0 comments on commit c6d025a

Please sign in to comment.