Skip to content

Commit

Permalink
Add some stuff for comment handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWandererProductions committed May 31, 2024
1 parent 8a542f5 commit 3dbabf2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Interpreter/IrtConst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ internal static class IrtConst
/// </summary>
internal const char NewCommand = ';';

/// <summary>
/// Indicator for comment, mostyl used for batch files, (const). Value: "--".
/// </summary>
internal const string CommentCommand = "--";

/// <summary>
/// The internal commands
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions Interpreter/IrtPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;

namespace Interpreter
Expand Down Expand Up @@ -57,6 +58,13 @@ internal void HandleInput(string inputString)
//clean string, remove trailing whitespace
inputString = inputString.Trim().ToUpper(CultureInfo.CurrentCulture).ToUpper(CultureInfo.InvariantCulture);

//handle File comments
if (inputString.StartsWith(IrtConst.CommentCommand))
{
Trace.WriteLine(inputString);
return;
}

//Help definition
if (inputString.Equals(IrtConst.InternalCommandHelp, StringComparison.InvariantCultureIgnoreCase))
{
Expand Down

0 comments on commit 3dbabf2

Please sign in to comment.