/// <summary> /// Creates a new Interpreter using the specified options. /// </summary> /// <param name="options"></param> public Interpreter(InterpreterOptions options) { var caseInsensitive = options.HasFlag(InterpreterOptions.CaseInsensitive); var allowSingleQuotedStrings = options.HasFlag(InterpreterOptions.AllowSingleQuotedStrings); _settings = new ParserSettings(caseInsensitive, allowSingleQuotedStrings); if ((options & InterpreterOptions.SystemKeywords) == InterpreterOptions.SystemKeywords) { SetIdentifiers(LanguageConstants.Literals); } if ((options & InterpreterOptions.PrimitiveTypes) == InterpreterOptions.PrimitiveTypes) { Reference(LanguageConstants.PrimitiveTypes); Reference(LanguageConstants.CSharpPrimitiveTypes); } if ((options & InterpreterOptions.CommonTypes) == InterpreterOptions.CommonTypes) { Reference(LanguageConstants.CommonTypes); } _visitors.Add(new DisableReflectionVisitor()); }
/// <summary> /// Creates a new Interpreter using the specified options. /// </summary> /// <param name="options"></param> public Interpreter(InterpreterOptions options) { var caseInsensitive = options.HasFlag(InterpreterOptions.CaseInsensitive); var lateBindObject = options.HasFlag(InterpreterOptions.LateBindObject); _settings = new ParserSettings(caseInsensitive, lateBindObject); if ((options & InterpreterOptions.SystemKeywords) == InterpreterOptions.SystemKeywords) { SetIdentifiers(LanguageConstants.Literals); } if ((options & InterpreterOptions.PrimitiveTypes) == InterpreterOptions.PrimitiveTypes) { Reference(LanguageConstants.PrimitiveTypes); Reference(LanguageConstants.CSharpPrimitiveTypes); } if ((options & InterpreterOptions.CommonTypes) == InterpreterOptions.CommonTypes) { Reference(LanguageConstants.CommonTypes); } if ((options & InterpreterOptions.LambdaExpressions) == InterpreterOptions.LambdaExpressions) { _settings.LambdaExpressions = true; } _visitors.Add(new DisableReflectionVisitor()); }
public Interpreter(InterpreterOptions options) { var caseInsensitive = options.HasFlag(InterpreterOptions.CaseInsensitive); _settings = new ParserSettings(caseInsensitive); if ((options & InterpreterOptions.SystemKeywords) == InterpreterOptions.SystemKeywords) { FillSystemKeywords(); } if ((options & InterpreterOptions.PrimitiveTypes) == InterpreterOptions.PrimitiveTypes) { FillPrimitiveTypes(); } if ((options & InterpreterOptions.CommonTypes) == InterpreterOptions.CommonTypes) { FillCommonTypes(); } }
/// <summary> /// Create a new Interpreter using the specified options. /// </summary> /// <param name="options"></param> public Interpreter(InterpreterOptions options) { var caseInsensitive = options.HasFlag(InterpreterOptions.CaseInsensitive); _settings = new ParserSettings(caseInsensitive); if ((options & InterpreterOptions.SystemKeywords) == InterpreterOptions.SystemKeywords) { SetIdentifiers(LanguageConstants.Literals); } if ((options & InterpreterOptions.PrimitiveTypes) == InterpreterOptions.PrimitiveTypes) { Reference(LanguageConstants.PrimitiveTypes); Reference(LanguageConstants.CSharpPrimitiveTypes); } if ((options & InterpreterOptions.CommonTypes) == InterpreterOptions.CommonTypes) { Reference(LanguageConstants.CommonTypes); } }