Skip to content

[SR-615][Compiler] Don't error when lexing UTF-8 BOM #1100

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

Merged
merged 1 commit into from
Jan 26, 2016

Conversation

tanadeau
Copy link
Contributor

No description provided.

@lattner
Copy link
Contributor

lattner commented Jan 26, 2016

Thanks for tackling this, some comments:

  • The patch will have the check be performed once per token lexed, it would make more sense for this to happen once per source file. As such, please move this to Lexer::Lexer or perhaps Lexer::primeLexer.
  • Please include a test case.

Thanks!

@lattner
Copy link
Contributor

lattner commented Jan 26, 2016

FWIW, the analogous code in clang is here:
https://github.com/apple/swift-clang/blob/stable/lib/Lex/Lexer.cpp#L68

@tanadeau
Copy link
Contributor Author

I moved the check to the Lexer's constructor and added a test case.

lattner added a commit that referenced this pull request Jan 26, 2016
[SR-615][Compiler] Don't error when lexing UTF-8 BOM
@lattner lattner merged commit 22e5ad8 into swiftlang:master Jan 26, 2016
@lattner
Copy link
Contributor

lattner commented Jan 26, 2016

LGTM, thanks!

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

Successfully merging this pull request may close these issues.

2 participants