git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] userdiff: Fix some corner cases in dts regex

From
Stephen Boyd <sboyd@kernel.org>
Date
Oct 16, 2019, 20:24 UTC
Message-ID
<20191016202423.3B5FF21835@mail.kernel.org>
In-Reply-To
<ab9b0dba-5c5b-5a97-07c5-ce8344cd74cd@kdbg.org>
Quoting Johannes Sixt (2019-10-12 05:54:00)
Show 21 quoted lines
> Am 08.10.19 um 16:43 schrieb Stephen Boyd:
> > Quoting Johannes Sixt (2019-10-05 07:09:11)
> >> Am 04.10.19 um 23:30 schrieb Stephen Boyd:
> >>> --- /dev/null
> >>> +++ b/t/t4018/dts-nodes-multiline-prop
> >>> @@ -0,0 +1,12 @@
> >>> +/ {
> >>> +     label_1: node1@ff00 {
> >>> +             RIGHT@deadf00,4000 {
> >>> +                     multilineprop = <3>,
> >>> +                                     <4>;
> >>
> >> You could insert more lines to demonstrate that "<x>," on a line by
> >> itself is not picked up.
> > 
> > Maybe I should add another test?
> 
> This is is the _multi_line test case, right? ;) Just add one or two
> lines between the <3> and the <4> that look like common real-world cases
> to show that those lines won't be picked up. I don't think that another
> test file is required.
Ok got it!
Show 24 quoted lines
> 
> >>> +/ { RIGHT /* Technically just supposed to be a slash and brace */
> >>
> >> Devil's advocate here: insert ';' or '=' in the comment, and the line
> >> would not be picked up. Does that hurt in practice?
> > 
> > I don't think it hurts in practice so I'd like to ignore it.
> 
> Sure, no problem.
> 
> >>>  PATTERNS("dts",
> >>>        "!;\n"
> >>> +      "!.*=.*\n"
> >>
> >> This behaves the same way as just
> >>
> >>         "!=\n"
> >>
> >> no?
> >>
> > 
> > Not exactly. Properties don't always get assigned.
> 
> I was just refering to the added line, not the combination of the two lines.
Ah ok. I'll reduce the line as you suggest then. Thanks.
Show 11 quoted lines
> 
> But while you are speaking of it:
> 
> > There are boolean
> > properties that can be tested for by the presence of some string with an
> > ending semi-colon, like 'this-is-true;'. If we just check for not equal
> > to a line with a semicolon and newline then we'll see boolean
> > properties. Should I add that as another test?
> 
> I agree that a test case with a Boolean property would be great.
> 
Alright I'll work on that and resend.
Previous: Johannes Sixt
Message 5 of 5 in “userdiff: Fix some corner cases in dts regex”
  1. userdiff: Fix some corner cases in dts regexStephen Boyd, Oct 4, 2019
  2. Johannes SixtOct 5, 2019
  3. Stephen BoydOct 8, 2019
  4. Johannes SixtOct 12, 2019
  5. Stephen BoydOct 16, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.