Example #1
0
 /// <summary>
 /// Parses the given text as Element code, adding each item to the GlobalScope
 /// </summary>
 /// <param name="globalScope">The globalScope to add the parsed items</param>
 /// <param name="context"></param>
 /// <param name="source">Where the source came from</param>
 /// <param name="text">The source code</param>
 public static void AddToGlobalScope(GlobalScope globalScope, CompilationContext context, string source, string text)
 {
     foreach (var b in Parse(text).Matches)
     {
         var func = ToFunction(globalScope, b, context, source);
         if (func is INamedType type)
         {
             globalScope.AddType(type, context);
         }
         else
         {
             globalScope.AddFunction((INamedFunction)func, context);
         }
     }
 }
Example #2
0
 protected Context(GlobalScope globalScope, CompilationInput compilationInput)
 {
     GlobalScope      = globalScope;
     CompilationInput = compilationInput;
 }
Example #3
0
 public CompilationContext(GlobalScope globalScope, CompilationInput compilationInput) : base(globalScope, compilationInput)
 {
 }