Skip to content

Commit c73a84a

Browse files
committed
---
yaml --- r: 33831 b: refs/heads/snap-stage3 c: 81a7960 h: refs/heads/master i: 33829: 2c5a6bd 33827: 67548c5 33823: 95e390e v: v3
1 parent 0b13ed1 commit c73a84a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 58e26243a7d7efa8e37703fb6dca95652c79f848
4+
refs/heads/snap-stage3: 81a79603c0c9c2425d0a8475d29b4ef77fae8607
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libsyntax/parse.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,18 @@ fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg,
175175
path: &Path) -> Result<Parser, ~str> {
176176
match io::read_whole_file_str(path) {
177177
result::Ok(move src) => {
178+
179+
// HACK: If the file contains a special token use a different
180+
// source file. Used to send the stage1+ parser (the stage0 parser
181+
// doesn't have this hack) to a different crate file.
182+
// Transitional. Remove me.
183+
let src = if src.starts_with("// DIVERT") {
184+
let actual_path = &path.with_filestem("alternate_crate");
185+
result::unwrap(io::read_whole_file_str(actual_path))
186+
} else {
187+
move src
188+
};
189+
178190
let filemap = sess.cm.new_filemap(path.to_str(), @move src);
179191
let srdr = lexer::new_string_reader(sess.span_diagnostic, filemap,
180192
sess.interner);

0 commit comments

Comments
 (0)