Skip to content

Commit dbae4b3

Browse files
committed
Marked adtional methods of Tokenise as private
This methods are only useful internally and are not used by core anywhere
1 parent 73e8a43 commit dbae4b3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mathics_scanner/tokeniser.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,9 @@ def __init__(self, feeder):
367367
self.feeder = feeder
368368
self.prescanner = Prescanner(feeder)
369369
self.code = self.prescanner.scan()
370-
self.change_mode("expr")
370+
self._change_mode("expr")
371371

372-
# TODO: Turn this into a setter in the future?
373-
def change_mode(self, mode):
372+
def _change_mode(self, mode):
374373
"""
375374
Set the mode of the tokeniser
376375
"""
@@ -396,7 +395,7 @@ def sntx_message(self, pos=None):
396395
# TODO: Convert this to __next__ in the future?
397396
def next(self):
398397
"Returns the next token"
399-
self.skip_blank()
398+
self._skip_blank()
400399
if self.pos >= len(self.code):
401400
return Token("END", "", len(self.code))
402401

@@ -428,7 +427,7 @@ def next(self):
428427
self.pos = match.end(0)
429428
return Token(tag, text, match.start(0))
430429

431-
def skip_blank(self):
430+
def _skip_blank(self):
432431
"Skip whitespace and comments"
433432
comment = [] # start positions of comments
434433
while True:
@@ -499,7 +498,7 @@ def _token_mode(self, match, tag, mode):
499498
"consume a token and switch mode"
500499
text = match.group(0)
501500
self.pos = match.end(0)
502-
self.change_mode(mode)
501+
self._change_mode(mode)
503502
return Token(tag, text, match.start(0))
504503

505504
def t_Get(self, match):

0 commit comments

Comments
 (0)