Skip to content

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

Merged
bors merged 6 commits into
rust-lang:masterfrom
eddyb:syn-file-loader
May 17, 2015
Merged

Abstract over the file loading mechanism in libsyntax's Parser.#25387
bors merged 6 commits into
rust-lang:masterfrom
eddyb:syn-file-loader

Conversation

@eddyb

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

r? @huonw

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

@eddyb

Copy link
Copy Markdown
ContributorAuthor

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

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

lgtm

@bors

bors commented May 16, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 07d4f77 has been approved by nikomatsakis

@bors

bors commented May 16, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 07d4f77 with merge f171456...

@bors

bors commented May 16, 2015

Copy link
Copy Markdown
Collaborator

💔 Test failed - auto-mac-64-opt

@eddyb

Copy link
Copy Markdown
ContributorAuthor

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

@eddyb

Copy link
Copy Markdown
ContributorAuthor

@bors r=nikomatsakis

@bors

bors commented May 16, 2015

Copy link
Copy Markdown
Collaborator

📌 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

bors commented May 17, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 8cc9878 with merge c23a9d4...

@bors

bors commented May 17, 2015

Copy link
Copy Markdown
Collaborator

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

@eddyb@rust-highfive@nikomatsakis@bors@huonw