dtc: Generate useful error message for properties after subnodes
On several occasions, I've accidentally put properties after subnodes in a dts file. I've then spent ages thinking that the resulting syntax error was because of something else. This patch arranges for this specific syntax error to generate a more specific and useful error message. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
parent
2b67c632df
commit
c048102f5b
|
@ -276,6 +276,11 @@ subnodes:
|
||||||
{
|
{
|
||||||
$$ = chain_node($1, $2);
|
$$ = chain_node($1, $2);
|
||||||
}
|
}
|
||||||
|
| subnode propdef
|
||||||
|
{
|
||||||
|
yyerror("syntax error: properties must precede subnodes\n");
|
||||||
|
YYERROR;
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
subnode:
|
subnode:
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
/ {
|
||||||
|
node1 {
|
||||||
|
};
|
||||||
|
prop;
|
||||||
|
node2 {
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in New Issue