diff options
| author | Jack Palevich <jackpal@google.com> | 2009-08-18 17:44:12 -0700 |
|---|---|---|
| committer | Jack Palevich <jackpal@google.com> | 2009-08-18 17:44:12 -0700 |
| commit | 0b1827a5b23a78da5ed88c4158c73b822b92f7a9 (patch) | |
| tree | fd21ff9abbf10395b7ed60c7b11ead94cefad441 /libacc/acc.cpp | |
| parent | 0b2de0de64666854c3621ddd69f580898776708e (diff) | |
| download | system_core-0b1827a5b23a78da5ed88c4158c73b822b92f7a9.tar.gz system_core-0b1827a5b23a78da5ed88c4158c73b822b92f7a9.tar.bz2 system_core-0b1827a5b23a78da5ed88c4158c73b822b92f7a9.zip | |
Allow '//'-style comments in #defines.
Diffstat (limited to 'libacc/acc.cpp')
| -rw-r--r-- | libacc/acc.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libacc/acc.cpp b/libacc/acc.cpp index 6c03657f..475e3087 100644 --- a/libacc/acc.cpp +++ b/libacc/acc.cpp @@ -3821,8 +3821,20 @@ class Compiler : public ErrorSink { inp(); } String value; + bool appendToValue = true; while (ch != '\n' && ch != EOF) { - value.append(ch); + // Check for '//' comments. + if (appendToValue && ch == '/') { + inp(); + if (ch == '/') { + appendToValue = false; + } else { + value.append('/'); + } + } + if (appendToValue && ch != EOF) { + value.append(ch); + } inp(); } char* pDefn = (char*)mGlobalArena.alloc(value.len() + 1); |
