Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Dec 23, 2023
1 parent d4cd043 commit d817f52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions StepLang/Expressions/Results/StringResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ public override StringResult DeepClone()
/// </summary>
/// <param name="value">The value to convert.</param>
/// <returns>The converted value.</returns>
/// <seealso cref="FromString"/>
public static implicit operator StringResult(string value) => new(value);

/// <summary>
/// Converts a <see cref="string"/> to a <see cref="StringResult"/>.
/// </summary>
/// <param name="value">The value to convert.</param>
/// <returns>The converted value.</returns>
/// <seealso cref="op_Implicit"/>
public static StringResult FromString(string value) => value;

/// <summary>
/// Concatenates two <see cref="StringResult"/>s to a new <see cref="StringResult"/>.
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion StepLang/Framework/Pure/SplitFunction.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using StepLang.Expressions.Results;
using StepLang.Interpreting;
using StepLang.Parsing;
using StepLang.Tokenizing;

namespace StepLang.Framework.Pure;
Expand All @@ -11,7 +12,7 @@ public class SplitFunction : GenericFunction<StringResult, StringResult>
protected override IEnumerable<NativeParameter> NativeParameters { get; } = new NativeParameter[]
{
new(OnlyString, "source"),
new(OnlyString, "separator", new StringResult("")),
new(OnlyString, "separator", LiteralExpressionNode.FromString("")),
};

protected override ListResult Invoke(TokenLocation callLocation, Interpreter interpreter, StringResult argument1, StringResult argument2)
Expand Down

0 comments on commit d817f52

Please sign in to comment.