[PATCH V2 2/2] dtc: cpp co-existence: add support for #line directives

Stephen Warren swarren at wwwdotorg.org
Fri Sep 28 01:53:01 EST 2012


On 09/27/2012 01:07 AM, David Gibson wrote:
> On Wed, Sep 26, 2012 at 10:18:05AM -0600, Stephen Warren wrote:
>> From: Stephen Warren <swarren at nvidia.com>
>>
>> Line control directives of the following formats are supported:
>>     #line LINE "FILE"
>>     # LINE "FILE" [FLAGS]
>>
>> This allows dtc to consume the output of pre-processors, and to provide
>> error messages that refer to the original filename, including taking
>> into account any #include directives that the pre-processor may have
>> performed.
>>
>> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> 
> Nice.  Two small changes I'd like to see:
> 
>> +<*>^"#"(line{WS}|" "){WS}*[0-9]+{WS}+{STRING}({WS}+[0-9]+)? {
> 
> I think this can be done slightly more cleanly as:
> ^"#"(line)?{WS}+[0-9]+{WS}+{STRING}({WS}+[0-9]+)?

Did you mean to ommit the <*> from the beginning there? I'm not sure
what the difference is between no start state tag and what I assume is a
wildcard tag.

Other than that, it looks like that should work; I'll try it out.


More information about the devicetree-discuss mailing list