@@ -31,34 +31,34 @@ def normalize(string: str):
3131
3232
3333def tokenize (string : str , * , trie : TITokenTrie = None , mode : str = None , normalize : bool = True ) -> list [TIToken ]:
34- r """
34+ """
3535 Tokenizes a string of tokens represented as text into a list of `TIToken` objects
3636
3737 Tokenization is performed using one of three procedures, dictated by ``mode``:
38- - ``max``: Always munch maximally, i.e. consume the most input possible to produce a token
39- - ``min``: Always munch minimally, i.e. consume the least input possible, which is often single characters
40- - ``smart``: Munch maximally or minimally depending on context
38+ - ``max``: Always munch maximally, i.e. consume the most input possible to produce a token
39+ - ``min``: Always munch minimally, i.e. consume the least input possible, which is often single characters
40+ - ``smart``: Munch maximally or minimally depending on context
4141
4242 The ``smart`` tokenization mode uses the following contexts, munching maximally otherwise:
43- - Strings: munch minimally, except when interpolating using ``Send(`` or storing to an equation
44- - Program names: munch minimally up to 8 tokens
45- - List names: munch minimally up to 5 tokens
43+ - Strings: munch minimally, except when interpolating using ``Send(`` or storing to an equation
44+ - Program names: munch minimally up to 8 tokens
45+ - List names: munch minimally up to 5 tokens
4646
4747 In all modes:
48- - Standard glyphs can be used for substituting Unicode symbols
49- - `\xXX` and `\uUUUU` output the denoted bytes exactly, regardless of validity
50- - `\ABCD` maximally munches `ABCD`, regardless of surrounding context
51- - Certain unprintable characters act as a hard separator for tokens
52- - U+001F (unit separator): `␟`
53- - U+200A (hair space): ` `
54- - U+200C (zero width non-joiner): ``
48+ - Standard glyphs can be used for substituting Unicode symbols
49+ - `\\ xXX` and `\ \ uUUUU` output the denoted bytes exactly, regardless of validity
50+ - `\ \ ABCD` maximally munches `ABCD`, regardless of surrounding context
51+ - Certain unprintable characters act as a hard separator for tokens
52+ - U+001F (unit separator): `␟`
53+ - U+200A (hair space): ` `
54+ - U+200C (zero width non-joiner): ``
5555
5656 For reference, here are the tokenization modes utilized by popular IDEs and other software:
57- - SourceCoder: ``max``
58- - TokenIDE: ``max``
59- - TI Connect CE: ¯\_(ツ)_/¯
60- - TI-Planet Project Builder: ``smart``
61- - tivars_lib_cpp: ``smart``
57+ - SourceCoder: ``max``
58+ - TokenIDE: ``max``
59+ - TI Connect CE: ¯\ \ _(ツ)_/¯
60+ - TI-Planet Project Builder: ``smart``
61+ - tivars_lib_cpp: ``smart``
6262
6363 :param string: The text string to encode
6464 :param trie: The `TokenTrie` object to use for tokenization (defaults to the TI-84+CE trie)
0 commit comments