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

Fix suggestion for #4253 #4256

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

OfekShilon
Copy link
Contributor

In the cpp tokenizer, angled brackets (<>) were separated from other brackets to hold an additional post-condition:

...
	[/[{}()\[\]]/, '@brackets'],
	[/[<>](?!@symbols)/, '@brackets'],    // <----

Not sure why, one guessed motivation is that a tokenizer needs to be extra careful with < since it might eventually resolve to the operator <<. However,

(1) this doesn't solve it, << is still not tokenized to an operator (it fails all tokenizer regexes),

(2) this extra-liberal exclusion causes bugs like #4253.

This suggested fix treats angled-brackets identically to other brackets. A true c++-conforming tokenizer might require @rematch and other heavy machinery, but this one is pretty certain to be at least some step forward.

@OfekShilon
Copy link
Contributor Author

Ping

@vscodenpa vscodenpa added this to the December / January 2024 milestone Dec 14, 2023
@hediet
Copy link
Member

hediet commented Dec 14, 2023

Thanks for the PR!

@hediet hediet merged commit 72dcedb into microsoft:main Dec 14, 2023
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants