Skip to content

Commit

Permalink
Trivial: Print the correct line / column for unexpected key
Browse files Browse the repository at this point in the history
Before it was  using the line / column infos of the containing node,
e.g. `0:0` at the document root.
  • Loading branch information
Geod24 authored and linked0 committed Sep 3, 2021
1 parent 1147483 commit 1f9d50f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/agora/common/Config.d
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private T parseMapping (T)
const fmt = path.length ? "Unexpected key '%s' in section '%s'. There are %s valid keys: %-(%s, %)" :
"Unexpected key '%s' in document root%s. There are %s valid keys: %-(%s, %)";
foreach (const ref Node key, const ref Node value; node)
node.enforce(fieldNames.canFind(key.as!string),
key.enforce(fieldNames.canFind(key.as!string),
fmt, key.as!string.paint(Red), path.paint(Green),
fieldNames.length.paint(Yellow), fieldNames.map!(f => f.paint(Green)));
}
Expand Down

0 comments on commit 1f9d50f

Please sign in to comment.