[cmake-developers] What about #line like feature in cmake language?

Brad King brad.king at kitware.com
Thu May 15 08:54:46 EDT 2014


On 05/15/2014 08:36 AM, Ben Boeckel wrote:
> If you'd like to try a patch, the relevant code is in
> Source/cmExprParser*. Add a callback for #line nnn and update the
> CurrentLine variable cmExprParserHelper.cxx. Don't forget tests :) .

cmExprParser is just for the math() command.  The language parser
is "cmListFileLexer.in.l" and "cmListFileCache.cxx".  Tracking of
the current source file may need to be moved.  The lexer would have
to recognize #line syntax and update lexer->line.  Be careful to
only do so in the main state and not inside a quoted or bracket
argument.

-Brad




More information about the cmake-developers mailing list