Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extmod/ure: Extend functionality #1544

Merged
merged 8 commits into from
Feb 14, 2019
Merged

extmod/ure: Extend functionality #1544

merged 8 commits into from
Feb 14, 2019

Conversation

notro
Copy link
Collaborator

@notro notro commented Feb 13, 2019

This PR adds:

  • 3 upstream commits which brings in the latest changes (upstream history)
  • One stalled patch by @deshipu that enabled me to parse ini file headers for the CPython configparser
  • One match(..., pos, endpos) patch that enabled me to port the CPython textwrap module without a lot of custom parsing code
  • Enable this on samd boards with a lot of flash (ie. the Grand Central)

This PR uses 1100 bytes of flash

@tannewt
Copy link
Member

tannewt commented Feb 14, 2019

I'm wary of splitting what re supports across m0 and m4 boards. What do you think about slimming down the SAMD clock stuff further to fit these changes? We're basically out of space in the m0 expresses so we'd need to trade out something for this.

dpgeorge and others added 8 commits February 14, 2019 15:42
This feature is controlled at compile time by MICROPY_PY_URE_MATCH_GROUPS,
disabled by default.

Thanks to @dmazzella for the original patch for this feature; see #3770.
This feature is controlled at compile time by
MICROPY_PY_URE_MATCH_SPAN_START_END, disabled by default.

Thanks to @dmazzella for the original patch for this feature; see #3770.
This feature is controlled at compile time by MICROPY_PY_URE_SUB, disabled
by default.

Thanks to @dmazzella for the original patch for this feature; see #3770.
Fix MicroPython #3176

Handle escape sequences inside regular expressions. This adds
handling for \a, \b, \f, \n, \r, \v and \\.
MICROPY_PY_URE_MATCH_SPAN_START_END is used to enable the functionality
since it's similar.
Remove the samd module which has representations of the clocks.
This is done to save on precious flash.
This enables ure.sub(), Match.span/start/end() and the
ure.Compile.search/match() pos/endpos arguments.
@notro
Copy link
Collaborator Author

notro commented Feb 14, 2019

I have removed the samd module on M0 which freed 1232 bytes of flash.
Also enabled the ure functionality on #if BOARD_FLASH_SIZE > 192000, which I assume is all Express boards.

@dhalbert
Copy link
Collaborator

Note that I have just started doing a large refactor of the #define stuff so we can have consistent settings across our ports. See #1547. I'm introducing an mpconfig_circuitpy.h file (or some name like that), which will have common settings, will check for small and large flash sizes, etc. Also I'll have on/off #defines for each native module so they are easily enabled/disabled in mpconfigport.h or mpconfigboard.h.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok great! Thank you for adding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpython api modules from cpython enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants