Skip to content

Commit

Permalink
(#63) Atoms: move most to the Shared assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jan 8, 2023
1 parent 60afe00 commit bb4e1fd
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 37 deletions.
34 changes: 34 additions & 0 deletions src/WpfMath.Shared/Atoms/Atom.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using WpfMath.Boxes;

namespace WpfMath.Atoms;

/// <summary>Atom (smallest unit) of TexFormula.</summary>
/// <param name="Source"></param>
/// <param name="Type"></param>
internal abstract record Atom(SourceSpan? Source, TexAtomType Type = TexAtomType.Ordinary)
{
public Box CreateBox(TexEnvironment environment)
{
var box = this.CreateBoxCore(environment);
if (box.Source == null)
{
box.Source = this.Source;
}

return box;
}

protected abstract Box CreateBoxCore(TexEnvironment environment);

// Gets type of leftmost child item.
public virtual TexAtomType GetLeftType()
{
return this.Type;
}

// Gets type of leftmost child item.
public virtual TexAtomType GetRightType()
{
return this.Type;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions src/WpfMath.Shared/WpfMath.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@
<InternalsVisibleTo Include="WpfMath.Tests" />
</ItemGroup>

<ItemGroup>
<Folder Include="Atoms" />
</ItemGroup>

</Project>
33 changes: 0 additions & 33 deletions src/WpfMath/Atoms/Atom.cs

This file was deleted.

0 comments on commit bb4e1fd

Please sign in to comment.