-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
616115e
commit 88b7fcb
Showing
4 changed files
with
59 additions
and
282 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/Draco.Compiler/Internal/Syntax/Formatting/SyntaxFormatAtom.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Draco.Compiler.Api.Syntax; | ||
|
||
namespace Draco.Compiler.Internal.Syntax.Formatting; | ||
|
||
/// <summary> | ||
/// A significant atomic piece of syntax in terms of formatting. | ||
/// | ||
/// This means general token and comments from trivia. | ||
/// Newlines and whitespace are not considered atoms. | ||
/// </summary> | ||
/// <param name="TokenKind">The token kind, in case it's a token.</param> | ||
/// <param name="TriviaKind>">The trivia kind, in case it's trivia.</param> | ||
/// <param name="Text">The text the atom represents.</param> | ||
internal readonly record struct SyntaxFormatAtom( | ||
TokenKind? TokenKind, | ||
TriviaKind? TriviaKind, | ||
string? Text); |
23 changes: 23 additions & 0 deletions
23
src/Draco.Compiler/Internal/Syntax/Formatting/SyntaxFormatter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Draco.Compiler.Internal.Syntax.Formatting; | ||
|
||
/// <summary> | ||
/// A formatter for the syntax tree. | ||
/// </summary> | ||
internal sealed class SyntaxFormatter | ||
{ | ||
/// <summary> | ||
/// The settings of the formatter. | ||
/// </summary> | ||
public SyntaxFormatterSettings Settings { get; } | ||
|
||
public SyntaxFormatter(SyntaxFormatterSettings settings) | ||
{ | ||
this.Settings = settings; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Draco.Compiler/Internal/Syntax/Formatting/SyntaxFormatterSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Draco.Compiler.Internal.Syntax.Formatting; | ||
|
||
/// <summary> | ||
/// The settings of the formatter. | ||
/// </summary> | ||
internal sealed class SyntaxFormatterSettings | ||
{ | ||
} |
282 changes: 0 additions & 282 deletions
282
src/Draco.Compiler/Internal/Syntax/SyntaxTreeFormatter.cs
This file was deleted.
Oops, something went wrong.