Skip to content

Commit 2e215b7

Browse files
committed
Merge branch 'sb/userdiff-dts'
Tweak userdiff patterns for dts. * sb/userdiff-dts: userdiff: fix some corner cases in dts regex
2 parents e3cf083 + 8da56a4 commit 2e215b7

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

t/t4018/dts-nodes-boolean-prop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/ {
2+
label_1: node1@ff00 {
3+
RIGHT@deadf00,4000 {
4+
boolean-prop1;
5+
6+
ChangeMe;
7+
};
8+
};
9+
};

t/t4018/dts-nodes-multiline-prop

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/ {
2+
label_1: node1@ff00 {
3+
RIGHT@deadf00,4000 {
4+
multilineprop = <3>,
5+
<4>,
6+
<5>,
7+
<6>,
8+
<7>;
9+
10+
ChangeMe = <0xffeedd00>;
11+
};
12+
};
13+
};

t/t4018/dts-root

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/RIGHT { /* Technically just supposed to be a slash */
1+
/ { RIGHT /* Technically just supposed to be a slash and brace */
22
#size-cells = <1>;
33

44
ChangeMe = <0xffeedd00>;

t/t4018/dts-root-comment

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/ { RIGHT /* Technically just supposed to be a slash and brace */
2+
#size-cells = <1>;
3+
4+
/* This comment should be ignored */
5+
6+
some-property = <40+2>;
7+
ChangeMe = <0xffeedd00>;
8+
};

userdiff.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ IPATTERN("ada",
2525
"|=>|\\.\\.|\\*\\*|:=|/=|>=|<=|<<|>>|<>"),
2626
PATTERNS("dts",
2727
"!;\n"
28+
"!=\n"
2829
/* lines beginning with a word optionally preceded by '&' or the root */
29-
"^[ \t]*((/|&?[a-zA-Z_]).*)",
30+
"^[ \t]*((/[ \t]*\\{|&?[a-zA-Z_]).*)",
3031
/* -- */
3132
/* Property names and math operators */
3233
"[a-zA-Z0-9,._+?#-]+"

0 commit comments

Comments
 (0)