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

Scope built in functions as support.function #287

Merged
merged 1 commit into from Nov 14, 2018

Conversation

Projects
None yet
3 participants
@Ben3eeE
Copy link
Member

Ben3eeE commented Nov 12, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Scopes built in python functions as support.function. Textmate scoped these as support.function.builtin.python.

#286 reported that print is no longer scoped as keyword.other. Textmate always scoped print and exec as keyword.other even when they were used as a function. In Python 3 these keywords were removed and print and exec are built in functions.

This PR fixes #286 by scoping all built in functions as support.function.

Function list taken from https://docs.python.org/3/library/functions.html

Alternate Designs

  • Don't scope built in functions separately
  • Incorrectly scope print and exec as a keyword to match textmate

Benefits

  • Built in functions are scoped the same as textmate
  • Correctly scopes print and exec as functions except when used as a keyword (python2)

Applicable Issues

Fixes #286

/cc: @maxbrunsfeld

@maxbrunsfeld

This comment has been minimized.

Copy link
Contributor

maxbrunsfeld commented Nov 13, 2018

Do the newlines in the regex affect anything?

@Ben3eeE

This comment has been minimized.

Copy link
Member Author

Ben3eeE commented Nov 13, 2018

Yeah, it makes the names around newlines not work 🐻

@50Wliu

This comment has been minimized.

Copy link
Member

50Wliu commented Nov 13, 2018

What about multiline ''' strings?

@Ben3eeE Ben3eeE force-pushed the b3-python-builtin branch from 3668419 to 38dd848 Nov 13, 2018

@Ben3eeE

This comment has been minimized.

Copy link
Member Author

Ben3eeE commented Nov 13, 2018

Couldn't get multiline strings to work.

@maxbrunsfeld

This comment has been minimized.

Copy link
Contributor

maxbrunsfeld commented Nov 13, 2018

What about multiline ''' strings?

I think that syntax will remove the leading whitespace from each line of the string, but there will still be a newline in there.

@Ben3eeE Ben3eeE merged commit e8e0d1b into master Nov 14, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Ben3eeE Ben3eeE deleted the b3-python-builtin branch Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.