Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fix for improper highlighting within the pointer access operator #195

Merged
merged 3 commits into from
Jan 10, 2017
Merged

Fix for improper highlighting within the pointer access operator #195

merged 3 commits into from
Jan 10, 2017

Conversation

busser
Copy link
Contributor

@busser busser commented Jan 8, 2017

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

This is a fix for issue #194 - any whitespace after a pointer access operator (->) would make tokenizing the operator fail, which in turn would impact syntax highlighting and any ligatures for that operator.

This change updates the regular expression used to identify valid uses of the pointer access operator to include operators directly followed by whitespace.

Benefits

Whitespace can now be added after a pointer access operator without affecting syntax highlighting or ligatures.

Possible Drawbacks

None. The change is minor.

@@ -286,7 +286,7 @@
'name': 'punctuation.separator.pointer-access.c'
'4':
'name': 'variable.other.member.c'
'match': '((\\.)|(->))([a-zA-Z_][a-zA-Z_0-9]*)\\b(?!\\s*\\()'
'match': '((\\.)|(->)\\s*)([a-zA-Z_][a-zA-Z_0-9]*)\\b(?!\\s*\\()'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the pattern should be ((\\.)|(->))\\s* instead. This is assuming C allows spaces in scenarios like a. b.

@winstliu
Copy link
Contributor

winstliu commented Jan 9, 2017

I would also appreciate a spec to test against any regressions.

Arthur Busser added 2 commits January 9, 2017 14:10
Update spec for tokenizing of dot access operator and pointer access operator
@winstliu
Copy link
Contributor

Looks good, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants