diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-03 14:13:01 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-03 14:13:01 +0100 |
| commit | a0f29fd390a37f79348e583bf6cdf8eaafd556f3 (patch) | |
| tree | d8e4e8ce59a091d01716271b672167a8660c48d1 /src/main | |
| parent | 3d4581cbac49ff887a53c21d064b19750f02f6e6 (diff) | |
Split out paths section of Rust AST
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriter.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriter.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriter.java index 5b3c041..926e3e3 100644 --- a/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriter.java +++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriter.java @@ -262,15 +262,21 @@ public class RustWriter implements AutoCloseable { void writeType(RustType type) throws IOException { switch (type) { case RustTypePath typePath -> { - writeWithSeparator( - typePath.segments(), - this::writeTypePathSegment, - () -> this.writer.write("::") - ); + writeTypePath(typePath); } } } + // == Paths == + + private void writeTypePath(RustTypePath typePath) throws IOException { + writeWithSeparator( + typePath.segments(), + this::writeTypePathSegment, + () -> this.writer.write("::") + ); + } + private void writeTypePathSegment(RustTypePathSegment segment) throws IOException { writePathIdentSegment(segment.pathIdentSegment()); |
