OSDN Git Service

Pass through literal space values from replacement lists.
authorCarl Worth <cworth@cworth.org>
Tue, 25 May 2010 23:59:02 +0000 (16:59 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 26 May 2010 00:06:08 +0000 (17:06 -0700)
commitf34a0009dd07dbca4de5491744bd3618eae9458e
treec96275b2c2abf42482717e5daaa685838003d344
parentb1854fdfb6b567fa61d544d8080e2acb4cc78dc1
Pass through literal space values from replacement lists.

This makes test 15 pass and also dramatically simplifies the lexer.

We were previously using a CONTROL state in the lexer to only emit
SPACE tokens when on text lines. But that's not actually what we
want. We need SPACE tokens in the replacement lists as well. Instead
of a lexer state for this, we now simply set a "space_tokens" flag
whenever we start constructing a pp_tokens list and clear the flag
whenever we see a '#' introducing a directive.

Much cleaner this way.
glcpp-lex.l
glcpp-parse.y
glcpp.h