This commit is contained in:
EugeneTes
2026-01-23 12:57:01 +01:00
parent fcb192b797
commit 71300aab24
15 changed files with 811 additions and 658 deletions

View File

@@ -1,6 +1,6 @@
namespace Inspectron.Epson.Templates.Language.Nodes;
public record EmptyLineNode(SourcePosition Position) : ITemplateNode
public record NewLineNode(SourcePosition Position) : ITemplateNode
{
public IReadOnlyList<ITemplateNode> Children => Array.Empty<ITemplateNode>();
}

View File

@@ -46,12 +46,10 @@ public class Parser
{
case TokenType.NewLine:
Advance();
// Check if this was an empty line (previous was also newline or start)
if (_position >= 2 && _tokens[_position - 2].Type == TokenType.NewLine)
{
return new EmptyLineNode(token.Position);
}
return null;
if(token.Position.Column==1)
return new NewLineNode(token.Position);
else
return null;
case TokenType.Text:
return ParseText();