mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-02 04:38:14 +00:00
[expr parser] rearrange expression errors to point right at the original metadesk nodes as much as possible
This commit is contained in:
@@ -302,6 +302,8 @@ operator_array[Op_##name].op = (MD_ExprOpr){ .op_id = Op_##name, .kind = MD_Expr
|
||||
// adding some extra parens, we can then compare it to the expected parenthisation of the
|
||||
// original input string. We get most of the topological comparison with a simpler test interface.
|
||||
Expression_QA tests[] = {
|
||||
{ .q = "a+", .a = "", ExpressionErrorKind_Expr, 2},
|
||||
|
||||
{ .q = "a + b + c", .a = "(a + b) + c" },
|
||||
{ .q = "a + (b + c)", .a = "a + (b + c)" },
|
||||
{ .q = "a + b + c + d", .a = "((a + b) + c) + d" },
|
||||
@@ -351,7 +353,7 @@ operator_array[Op_##name].op = (MD_ExprOpr){ .op_id = Op_##name, .kind = MD_Expr
|
||||
{ .q = "a)", .a = "", ExpressionErrorKind_MD, 1},
|
||||
{ .q = "/a", .a = "", ExpressionErrorKind_Expr, 0},
|
||||
{ .q = "+ /a", .a = "", ExpressionErrorKind_Expr, 2},
|
||||
{ .q = "a+", .a = "", ExpressionErrorKind_Expr, 2},
|
||||
//{ .q = "a+", .a = "", ExpressionErrorKind_Expr, 2},
|
||||
{ .q = "a 1", .a = "", ExpressionErrorKind_Expr, 2},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user