зеркало из https://github.com/microsoft/Power-Fx.git
Fixes to enable SQL parser - it depends on CheckResult. (#334)
This commit is contained in:
Родитель
85fbcf4bf9
Коммит
4af647f3e3
|
@ -19,12 +19,13 @@ namespace Microsoft.PowerFx.Core.Public
|
|||
/// </summary>
|
||||
public bool AllowsSideEffects { get; set; }
|
||||
|
||||
internal ILanguageSettings LanguageSettings { get; set; }
|
||||
|
||||
internal ParseResult Parse(string script)
|
||||
{
|
||||
var flags = AllowsSideEffects ? TexlParser.Flags.EnableExpressionChaining : TexlParser.Flags.None;
|
||||
ILanguageSettings loc = null;
|
||||
|
||||
return TexlParser.ParseScript(script, loc, flags);
|
||||
return TexlParser.ParseScript(script, LanguageSettings, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,12 +34,15 @@ namespace Microsoft.PowerFx.Core.Public
|
|||
/// List of errors and warnings. Check <see cref="ExpressionError.IsWarning"/>.
|
||||
/// Not null, but empty on success.
|
||||
/// </summary>
|
||||
public IEnumerable<ExpressionError> Errors => Parse != null ?
|
||||
Parse.Errors.Concat(BindingErrors) :
|
||||
BindingErrors;
|
||||
public IEnumerable<ExpressionError> Errors { get; set; }
|
||||
|
||||
private IEnumerable<ExpressionError> BindingErrors => ExpressionError.New(_binding.ErrorContainer.GetErrors());
|
||||
|
||||
internal void SetErrors(IEnumerable<IDocumentError> errors)
|
||||
{
|
||||
Errors = ExpressionError.New(errors);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parsed expression for evaluation.
|
||||
/// Null on failure or if there is no evaluation.
|
||||
|
@ -70,6 +73,8 @@ namespace Microsoft.PowerFx.Core.Public
|
|||
Parse = parse ?? throw new ArgumentNullException(nameof(parse));
|
||||
|
||||
_binding = binding;
|
||||
|
||||
Errors = Parse.Errors.Concat(BindingErrors);
|
||||
}
|
||||
|
||||
public void ThrowOnErrors()
|
||||
|
|
Загрузка…
Ссылка в новой задаче