Skip to content

Commit

Permalink
Threw out old formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Oct 22, 2023
1 parent 616115e commit 88b7fcb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 282 deletions.
22 changes: 22 additions & 0 deletions src/Draco.Compiler/Internal/Syntax/Formatting/SyntaxFormatAtom.cs
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 src/Draco.Compiler/Internal/Syntax/Formatting/SyntaxFormatter.cs
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;
}
}
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 src/Draco.Compiler/Internal/Syntax/SyntaxTreeFormatter.cs

This file was deleted.

0 comments on commit 88b7fcb

Please sign in to comment.