Skip to content

Commit

Permalink
Added file functions to global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Sep 4, 2023
1 parent 8e71a4c commit 9adf037
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions StepLang/Interpreting/Scope.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using StepLang.Framework.Conversion;
using StepLang.Framework.IO;
using StepLang.Framework.Other;
using StepLang.Framework.Pure;
using StepLang.Framework.Reflection;
using StepLang.Parsing.Expressions;
Expand Down Expand Up @@ -33,6 +34,12 @@ private Scope()
// pure functions
SetVariable(SubstringFunction.Identifier, new FunctionResult(new SubstringFunction()));

// other functions
SetVariable(FileExistsFunction.Identifier, new FunctionResult(new FileExistsFunction()));
SetVariable(FileReadFunction.Identifier, new FunctionResult(new FileReadFunction()));
SetVariable(FileWriteFunction.Identifier, new FunctionResult(new FileWriteFunction()));
SetVariable(FileDeleteFunction.Identifier, new FunctionResult(new FileDeleteFunction()));

SetVariable("null", NullResult.Instance);

SetVariable("EOL", new StringResult(Environment.NewLine));
Expand Down

0 comments on commit 9adf037

Please sign in to comment.