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

Abstract over the file loading mechanism in libsyntax's Parser. #25387

Merged
merged 6 commits into from
May 17, 2015

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented May 13, 2015

This allows compiling entire crates from memory or preprocessing source files before they are tokenized.

Minor API refactoring included, which is a [breaking-change] for libsyntax users:

  • ParseSess::{next_node_id, reserve_node_ids} moved to rustc's Session
  • new_parse_sess -> ParseSess::new
  • new_parse_sess_special_handler -> ParseSess::with_span_handler
  • mk_span_handler -> SpanHandler::new
  • default_handler -> Handler::new
  • mk_handler -> Handler::with_emitter
  • string_to_filemap(sess source, path) -> sess.codemap().new_filemap(path, source)

@rust-highfive
Copy link
Collaborator

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@eddyb
Copy link
Member Author

eddyb commented May 14, 2015

cc @nikomatsakis This is the custom file-loading API I was telling you about.

@nikomatsakis
Copy link
Contributor

@bors r+

lgtm

@bors
Copy link
Contributor

bors commented May 16, 2015

📌 Commit 07d4f77 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented May 16, 2015

⌛ Testing commit 07d4f77 with merge f171456...

@bors
Copy link
Contributor

bors commented May 16, 2015

💔 Test failed - auto-mac-64-opt

@eddyb
Copy link
Member Author

eddyb commented May 16, 2015

My bad, I've missed the error message change for loading non-UTF8 files.

@eddyb
Copy link
Member Author

eddyb commented May 16, 2015

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented May 16, 2015

📌 Commit 8cc9878 has been approved by nikomatsakis

bors added a commit that referenced this pull request May 17, 2015
This allows compiling entire crates from memory or preprocessing source files before they are tokenized.

Minor API refactoring included, which is a [breaking-change] for libsyntax users:
* `ParseSess::{next_node_id, reserve_node_ids}` moved to rustc's `Session`
* `new_parse_sess` -> `ParseSess::new`
* `new_parse_sess_special_handler` -> `ParseSess::with_span_handler`
* `mk_span_handler` -> `SpanHandler::new`
* `default_handler` -> `Handler::new`
* `mk_handler` -> `Handler::with_emitter`
* `string_to_filemap(sess source, path)` -> `sess.codemap().new_filemap(path, source)`
@bors
Copy link
Contributor

bors commented May 17, 2015

⌛ Testing commit 8cc9878 with merge c23a9d4...

@bors bors merged commit 8cc9878 into rust-lang:master May 17, 2015
@eddyb eddyb deleted the syn-file-loader branch May 17, 2015 08:54
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.

5 participants