You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a port of MicroPython which includes the ure module. I tried to bring in the textwrap module from this project, but ran into a couple of issues:
wordsep_re = re.compile(
r'(\s+|' # any whitespace
r'[^\s\w]*\w+[^0-9\W]-(?=\w+[^0-9\W])|' # hyphenated words
r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash
This regular expression does not compile cleanly as ure does not support the (?= notation
What do you actually need this module for? I'm not seeing any obvious reasons why a microcontroller needs to do text wrapping.
More specifically, if we were to make a much simpler subset implementation rather than making all the features of the CPython version work, what exact features would you require?
If you don't use the dedent function or don't require break_on_hyphens to be set to True for the wrap, then all you have to do is remove the lines that use the re features that aren't supported and this will work fine.
I have a port of MicroPython which includes the ure module. I tried to bring in the textwrap module from this project, but ran into a couple of issues:
This regular expression does not compile cleanly as ure does not support the (?= notation
These two also fail to compile, in this case because the MULTILINE flag is missing
The text was updated successfully, but these errors were encountered: