summaryrefslogtreecommitdiff
path: root/src/source.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/source.rs b/src/source.rs
index 85f48491..e692ac94 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -144,6 +144,11 @@ impl SourceFile {
}
}
+ /// Create a source file without a real id and path, usually for testing.
+ pub fn detached(src: impl Into<String>) -> Self {
+ Self::new(SourceId(0), Path::new(""), src.into())
+ }
+
/// The file's abstract syntax tree.
pub fn ast(&self) -> TypResult<Markup> {
let red = RedNode::from_root(self.root.clone(), self.id);
@@ -155,11 +160,6 @@ impl SourceFile {
}
}
- /// Create a source file without a real id and path, usually for testing.
- pub fn detached(src: impl Into<String>) -> Self {
- Self::new(SourceId(0), Path::new(""), src.into())
- }
-
/// The id of the source file.
pub fn id(&self) -> SourceId {
self.id