dtc: ignore lines starting with #.
This is necessary because we use the C pre-processor to parse #include lines and cpp adds line markings that start with #.
This commit is contained in:
parent
23afbfa96e
commit
7f78c17319
@ -151,7 +151,7 @@ input_buffer::next_token()
|
|||||||
start = cursor;
|
start = cursor;
|
||||||
skip_spaces();
|
skip_spaces();
|
||||||
// Parse /* comments
|
// Parse /* comments
|
||||||
if (((*this)[0] == '/') && ((*this)[1] == '*'))
|
if ((*this)[0] == '/' && (*this)[1] == '*')
|
||||||
{
|
{
|
||||||
// eat the start of the comment
|
// eat the start of the comment
|
||||||
++(*this);
|
++(*this);
|
||||||
@ -168,13 +168,14 @@ input_buffer::next_token()
|
|||||||
// Eat the /
|
// Eat the /
|
||||||
++(*this);
|
++(*this);
|
||||||
}
|
}
|
||||||
// Parse // comments
|
// Parse // comments and # comments
|
||||||
if (((*this)[0] == '/') && ((*this)[1] == '/'))
|
if (((*this)[0] == '/' && (*this)[1] == '/') ||
|
||||||
|
(*this)[0] == '#')
|
||||||
{
|
{
|
||||||
// eat the start of the comment
|
// eat the start of the comment
|
||||||
++(*this);
|
++(*this);
|
||||||
++(*this);
|
++(*this);
|
||||||
// Find the ending * of */
|
// Find the ending of the line
|
||||||
while (**this != '\n')
|
while (**this != '\n')
|
||||||
{
|
{
|
||||||
++(*this);
|
++(*this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user