internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros

This commit is contained in:
Lukas Wirth 2024-04-14 16:02:38 +02:00
parent 83370fe5d7
commit a483d3bc37
39 changed files with 187 additions and 145 deletions

View file

@ -120,7 +120,7 @@ impl<N: AstNode> From<AstPtr<N>> for SyntaxNodePtr {
fn test_local_syntax_ptr() {
use crate::{ast, AstNode, SourceFile};
let file = SourceFile::parse("struct Foo { f: u32, }").ok().unwrap();
let file = SourceFile::parse("struct Foo { f: u32, }", parser::Edition::CURRENT).ok().unwrap();
let field = file.syntax().descendants().find_map(ast::RecordField::cast).unwrap();
let ptr = SyntaxNodePtr::new(field.syntax());
let field_syntax = ptr.to_node(file.syntax());