system/corennnnn
Révision | 9d1296898a93293e64529d548189bfc8185ffd08 (tree) |
---|---|
l'heure | 2009-08-19 09:46:17 |
Auteur | Android (Google) Code Review <android-gerrit@goog...> |
Commiter | Android (Google) Code Review |
Merge change 21834 into eclair
* changes:
@@ -3821,8 +3821,20 @@ class Compiler : public ErrorSink { | ||
3821 | 3821 | inp(); |
3822 | 3822 | } |
3823 | 3823 | String value; |
3824 | + bool appendToValue = true; | |
3824 | 3825 | while (ch != '\n' && ch != EOF) { |
3825 | - value.append(ch); | |
3826 | + // Check for '//' comments. | |
3827 | + if (appendToValue && ch == '/') { | |
3828 | + inp(); | |
3829 | + if (ch == '/') { | |
3830 | + appendToValue = false; | |
3831 | + } else { | |
3832 | + value.append('/'); | |
3833 | + } | |
3834 | + } | |
3835 | + if (appendToValue && ch != EOF) { | |
3836 | + value.append(ch); | |
3837 | + } | |
3826 | 3838 | inp(); |
3827 | 3839 | } |
3828 | 3840 | char* pDefn = (char*)mGlobalArena.alloc(value.len() + 1); |
@@ -1,7 +1,8 @@ | ||
1 | 1 | // Simple tests of the C preprocessor |
2 | 2 | |
3 | -#define A (1 + 2) | |
3 | +#define A (4 / 2) | |
4 | +#define B 1 // This is a comment. With a / in it. | |
4 | 5 | |
5 | 6 | int main() { |
6 | - return A; | |
7 | + return A + B; | |
7 | 8 | } |