• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Révision9d1296898a93293e64529d548189bfc8185ffd08 (tree)
l'heure2009-08-19 09:46:17
AuteurAndroid (Google) Code Review <android-gerrit@goog...>
CommiterAndroid (Google) Code Review

Message de Log

Merge change 21834 into eclair

* changes:

Allow '//'-style comments in #defines.

Change Summary

Modification

--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -3821,8 +3821,20 @@ class Compiler : public ErrorSink {
38213821 inp();
38223822 }
38233823 String value;
3824+ bool appendToValue = true;
38243825 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+ }
38263838 inp();
38273839 }
38283840 char* pDefn = (char*)mGlobalArena.alloc(value.len() + 1);
--- a/libacc/tests/data/defines.c
+++ b/libacc/tests/data/defines.c
@@ -1,7 +1,8 @@
11 // Simple tests of the C preprocessor
22
3-#define A (1 + 2)
3+#define A (4 / 2)
4+#define B 1 // This is a comment. With a / in it.
45
56 int main() {
6- return A;
7+ return A + B;
78 }