manpagez: man pages & more
info texinfo
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19.6.3 ‘#line’ Syntax Details

Syntax details for the ‘#line’ directive: the ‘#’ character can be preceded or followed by whitespace, the word ‘line’ is optional, and the file name can be followed by a whitespace-separated list of integers (these are so-called “flags” output by CPP in some cases). For those who like to know the gory details, the actual (Perl) regular expression which is matched is this:

/^\s*#\s*(line)? (\d+)(( "([^"]+)")(\s+\d+)*)?\s*$/

As far as we’ve been able to tell, the trailing integer flags only occur in conjunction with a filename, so that is reflected in the regular expression.

As an example, the following is a syntactically valid ‘#line’ directive, meaning line 1 of ‘/usr/include/stdio.h’:

@hashchar{} 1 "/usr/include/stdio.h" 2 3 4

Unfortunately, the quoted filename (‘"..."’) has to be optional, because M4 (especially) can often generate ‘#line’ directives within a single file. Since the ‘line’ is also optional, the result is that lines might match which you wouldn’t expect, e.g.,

@hashchar{} 1

The possible solutions are described above (see section #line’ Directive).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October 2, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.