Merge branch 'sb/userdiff-dts'

Tweak userdiff patterns for dts.

* sb/userdiff-dts:
  userdiff: fix some corner cases in dts regex
This commit is contained in:
Junio C Hamano 2019-10-23 14:43:10 +09:00
commit 2e215b7959
5 changed files with 33 additions and 2 deletions

View file

@ -0,0 +1,9 @@
/ {
label_1: node1@ff00 {
RIGHT@deadf00,4000 {
boolean-prop1;
ChangeMe;
};
};
};

View file

@ -0,0 +1,13 @@
/ {
label_1: node1@ff00 {
RIGHT@deadf00,4000 {
multilineprop = <3>,
<4>,
<5>,
<6>,
<7>;
ChangeMe = <0xffeedd00>;
};
};
};

View file

@ -1,4 +1,4 @@
/RIGHT { /* Technically just supposed to be a slash */
/ { RIGHT /* Technically just supposed to be a slash and brace */
#size-cells = <1>;
ChangeMe = <0xffeedd00>;

8
t/t4018/dts-root-comment Normal file
View file

@ -0,0 +1,8 @@
/ { RIGHT /* Technically just supposed to be a slash and brace */
#size-cells = <1>;
/* This comment should be ignored */
some-property = <40+2>;
ChangeMe = <0xffeedd00>;
};

View file

@ -25,8 +25,9 @@ IPATTERN("ada",
"|=>|\\.\\.|\\*\\*|:=|/=|>=|<=|<<|>>|<>"),
PATTERNS("dts",
"!;\n"
"!=\n"
/* lines beginning with a word optionally preceded by '&' or the root */
"^[ \t]*((/|&?[a-zA-Z_]).*)",
"^[ \t]*((/[ \t]*\\{|&?[a-zA-Z_]).*)",
/* -- */
/* Property names and math operators */
"[a-zA-Z0-9,._+?#-]+"