diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-11-28 16:20:41 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-11-28 17:09:26 -0800 |
| commit | 65bd40e300323f1e4806dd84834b8d71bb89c08c (patch) | |
| tree | 53b9245b13ba9991627a0e23b8378a328af42ad4 /src/libsyntax/ext | |
| parent | 9b95d511316ae7124046de61d19335fdfaa021cc (diff) | |
| download | rust-65bd40e300323f1e4806dd84834b8d71bb89c08c.tar.gz rust-65bd40e300323f1e4806dd84834b8d71bb89c08c.zip | |
Remove uses of #[merge]
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/pipes.rs | 67 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/mod.rs | 70 |
2 files changed, 70 insertions, 67 deletions
diff --git a/src/libsyntax/ext/pipes.rs b/src/libsyntax/ext/pipes.rs deleted file mode 100644 index b4c49b12d59..00000000000 --- a/src/libsyntax/ext/pipes.rs +++ /dev/null @@ -1,67 +0,0 @@ -/*! Implementation of proto! extension. - -This is frequently called the pipe compiler. It handles code such as... - -~~~ -proto! pingpong ( - ping: send { - ping -> pong - } - pong: recv { - pong -> ping - } -) -~~~ - -There are several components: - - * The parser (libsyntax/ext/pipes/parse_proto.rs) - * Responsible for building an AST from a protocol specification. - - * The checker (libsyntax/ext/pipes/check.rs) - * Basic correctness checking for protocols (i.e. no undefined states, etc.) - - * The analyzer (libsyntax/ext/pipes/liveness.rs) - * Determines whether the protocol is bounded or unbounded. - - * The compiler (libsynatx/ext/pipes/pipec.rs) - * Generates a Rust AST from the protocol AST and the results of analysis. - -There is more documentation in each of the files referenced above. - -FIXME (#3072) - This is still incomplete. - -*/ - -use codemap::span; -use ext::base::ext_ctxt; -use ast::tt_delim; -use parse::lexer::{new_tt_reader, reader}; -use parse::parser::Parser; -use parse::common::parser_common; - -use pipes::parse_proto::proto_parser; - -use pipes::proto::{visit, protocol}; - -fn expand_proto(cx: ext_ctxt, _sp: span, id: ast::ident, - tt: ~[ast::token_tree]) -> base::mac_result -{ - let sess = cx.parse_sess(); - let cfg = cx.cfg(); - let tt_rdr = new_tt_reader(cx.parse_sess().span_diagnostic, - cx.parse_sess().interner, None, tt); - let rdr = tt_rdr as reader; - let rust_parser = Parser(sess, cfg, rdr.dup()); - - let proto = rust_parser.parse_proto(cx.str_of(id)); - - // check for errors - visit(proto, cx); - - // do analysis - liveness::analyze(proto, cx); - - // compile - base::mr_item(proto.compile(cx)) -} diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs index 638ccad0143..b064f39eb3a 100644 --- a/src/libsyntax/ext/pipes/mod.rs +++ b/src/libsyntax/ext/pipes/mod.rs @@ -1,3 +1,49 @@ +/*! Implementation of proto! extension. + +This is frequently called the pipe compiler. It handles code such as... + +~~~ +proto! pingpong ( + ping: send { + ping -> pong + } + pong: recv { + pong -> ping + } +) +~~~ + +There are several components: + + * The parser (libsyntax/ext/pipes/parse_proto.rs) + * Responsible for building an AST from a protocol specification. + + * The checker (libsyntax/ext/pipes/check.rs) + * Basic correctness checking for protocols (i.e. no undefined states, etc.) + + * The analyzer (libsyntax/ext/pipes/liveness.rs) + * Determines whether the protocol is bounded or unbounded. + + * The compiler (libsynatx/ext/pipes/pipec.rs) + * Generates a Rust AST from the protocol AST and the results of analysis. + +There is more documentation in each of the files referenced above. + +FIXME (#3072) - This is still incomplete. + +*/ + +use codemap::span; +use ext::base::ext_ctxt; +use ast::tt_delim; +use parse::lexer::{new_tt_reader, reader}; +use parse::parser::Parser; +use parse::common::parser_common; + +use pipes::parse_proto::proto_parser; + +use pipes::proto::{visit, protocol}; + #[legacy_exports] mod ast_builder; #[legacy_exports] @@ -10,3 +56,27 @@ mod proto; mod check; #[legacy_exports] mod liveness; + + +fn expand_proto(cx: ext_ctxt, _sp: span, id: ast::ident, + tt: ~[ast::token_tree]) -> base::mac_result +{ + let sess = cx.parse_sess(); + let cfg = cx.cfg(); + let tt_rdr = new_tt_reader(cx.parse_sess().span_diagnostic, + cx.parse_sess().interner, None, tt); + let rdr = tt_rdr as reader; + let rust_parser = Parser(sess, cfg, rdr.dup()); + + let proto = rust_parser.parse_proto(cx.str_of(id)); + + // check for errors + visit(proto, cx); + + // do analysis + liveness::analyze(proto, cx); + + // compile + base::mr_item(proto.compile(cx)) +} + |
