Browse Source
fix some query error and print out more detailed exceptions in query parser (#20170)
pull/20178/head
Emmanuel Hansen
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
3 deletions
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/Transformers/AvaloniaXamlIlQueryTransformer.cs
-
src/Markup/Avalonia.Markup/Markup/Parsers/ContainerQueryGrammar.cs
|
|
|
@ -98,7 +98,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers |
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
|
throw new XamlParseException("Unable to parse query: " + e.Message, node); |
|
|
|
throw new XamlParseException("Unable to parse query: " + e, node); |
|
|
|
} |
|
|
|
|
|
|
|
var query = Create(parsed); |
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ namespace Avalonia.Markup.Parsers |
|
|
|
if (identifier.SequenceEqual(MinWidthKeyword.AsSpan()) || identifier.SequenceEqual(MaxWidthKeyword.AsSpan()) || identifier.SequenceEqual(WidthKeyword.AsSpan())) |
|
|
|
{ |
|
|
|
if (!r.TakeIf(':')) |
|
|
|
throw new ExpressionParseException(r.Position, "Expected ':' after 'orientation'."); |
|
|
|
throw new ExpressionParseException(r.Position, $"Expected ':' after '{identifier}'."); |
|
|
|
double val = ParseDecimal(ref r); |
|
|
|
|
|
|
|
var syntax = new WidthSyntax() |
|
|
|
@ -101,7 +101,7 @@ namespace Avalonia.Markup.Parsers |
|
|
|
if (identifier.SequenceEqual(MinHeightKeyword.AsSpan()) || identifier.SequenceEqual(MaxHeightKeyword.AsSpan()) || identifier.SequenceEqual(HeightKeyword.AsSpan())) |
|
|
|
{ |
|
|
|
if (!r.TakeIf(':')) |
|
|
|
throw new ExpressionParseException(r.Position, "Expected ':' after 'orientation'."); |
|
|
|
throw new ExpressionParseException(r.Position, $"Expected ':' after '{identifier}'."); |
|
|
|
double val = ParseDecimal(ref r); |
|
|
|
|
|
|
|
var syntax = new HeightSyntax() |
|
|
|
|