diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-29 07:40:39 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-29 07:40:39 +0100 |
commit | 7a1cae59acf72f821343b2ba10ef69fb92a5b952 (patch) | |
tree | 26e606ccd132a24e9bc89cf174e4adadf60c5992 /crates/ra_mbe/src/mbe_expander.rs | |
parent | b0d84cb8faefedde7ace4ff152a2a13408e79e5d (diff) | |
parent | 80a17251473bd6213a4c8a51ea7f732394d173c5 (diff) |
Merge #1337
1337: Move syntax errors our of syntax tree r=matklad a=matklad
I am not really sure if it's a good idea, but `SyntaxError` do not really belong to a `SyntaxTree`. So let's just store them on the side?
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r-- | crates/ra_mbe/src/mbe_expander.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index 7fff8deff..a0bd0c5f8 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs | |||
@@ -597,7 +597,7 @@ mod tests { | |||
597 | } | 597 | } |
598 | 598 | ||
599 | fn create_rules(macro_definition: &str) -> crate::MacroRules { | 599 | fn create_rules(macro_definition: &str) -> crate::MacroRules { |
600 | let source_file = ast::SourceFile::parse(macro_definition); | 600 | let source_file = ast::SourceFile::parse(macro_definition).ok().unwrap(); |
601 | let macro_definition = | 601 | let macro_definition = |
602 | source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); | 602 | source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); |
603 | 603 | ||
@@ -609,7 +609,7 @@ mod tests { | |||
609 | rules: &crate::MacroRules, | 609 | rules: &crate::MacroRules, |
610 | invocation: &str, | 610 | invocation: &str, |
611 | ) -> Result<tt::Subtree, ExpandError> { | 611 | ) -> Result<tt::Subtree, ExpandError> { |
612 | let source_file = ast::SourceFile::parse(invocation); | 612 | let source_file = ast::SourceFile::parse(invocation).ok().unwrap(); |
613 | let macro_invocation = | 613 | let macro_invocation = |
614 | source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); | 614 | source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); |
615 | 615 | ||