[PATCH v3 3/3] dtc: Support character literals in bytestrings

Anton Staaf robotboy at google.com
Sat Sep 10 01:31:25 EST 2011


On Fri, Sep 9, 2011 at 12:01 AM, David Gibson
<david at gibson.dropbear.id.au> wrote:
> On Thu, Sep 08, 2011 at 11:37:21PM -0700, Anton Staaf wrote:
>> On Thu, Sep 8, 2011 at 6:15 PM, David Gibson
>> <david at gibson.dropbear.id.au> wrote:
>> > On Thu, Sep 08, 2011 at 02:39:17PM -0700, Anton Staaf wrote:
>> >> With this patch the following property assignment:
>> >>
>> >>     property = ['a' 2b '\r'];
>> >>
>> >> is equivalent to:
>> >>
>> >>     property = [61 2b 0d];
>> >
>> > [snip]
>> >> +<BYTESTRING>{CHAR_LITERAL} {
>> >
>> > You should just be able to make the existing rule a <*> one,
>> > rather than having a separate rule for BYTESTRING context.
>>
>> I thought about that too, but I was concerned that it would then allow
>> character literals in properties outside of the cell list or
>> bytestring syntax.  Which I suppose is exactly what you had suggested
>> before now that I think about it.  And would end up being no more
>> ambiguous, and possibly more internally consistent.  I'll make the
>> change and add a test case that shows that functionality as well if
>> that makes sense to you.
>
> Well, it would allow character literals to be *lexed* in other places,
> but the parser would still reject them outside of the (so far)
> intended contexts without further changes.

True, and it simplifies the lexer.  OK, I'll make that change as well.

Thanks,
    Anton

> --
> David Gibson                    | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
>                                | _way_ _around_!
> http://www.ozlabs.org/~dgibson
>


More information about the devicetree-discuss mailing list