Loading libacc/acc.cpp +1 −5 Original line number Diff line number Diff line Loading @@ -4409,15 +4409,11 @@ class Compiler : public ErrorSink { Type* acceptDecl2(Type* pType, tokenid_t& declName, bool nameAllowed, bool nameRequired, bool& reportFailure) { int ptrCounter = 0; while (accept('*')) { ptrCounter++; pType = createType(TY_POINTER, pType, NULL); } pType = acceptDecl3(pType, declName, nameAllowed, nameRequired, reportFailure); while (ptrCounter-- > 0) { pType = createType(TY_POINTER, pType, NULL); } return pType; } Loading libacc/tests/data/assignmentop.c +2 −6 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ void testAssignment() { printf("16|= 1 %d\n", a); } /* Can't use because int* f() is not parsed as a function decl. int a; int* f() { Loading @@ -43,24 +42,21 @@ int* f() { void testEval() { a = 0; printf("*f() = *f() + 10;"); printf("*f() = *f() + 10;\n"); *f() = *f() + 10; printf("a = %d\n", a); } void testOpEval() { a = 0; printf("*f() += 10;"); printf("*f() += 10;\n"); *f() += 10; printf("a = %d\n", a); } */ int main() { testAssignment(); /* testEval(); testOpEval(); */ return 0; } libacc/tests/test.py +7 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,13 @@ result: 0""", """2 *= 5 10 17&= 1 1 17^= 1 16 16|= 1 17 *f() = *f() + 10; f() f() a = 10 *f() += 10; f() a = 10 """) def testcomma(self): Loading Loading
libacc/acc.cpp +1 −5 Original line number Diff line number Diff line Loading @@ -4409,15 +4409,11 @@ class Compiler : public ErrorSink { Type* acceptDecl2(Type* pType, tokenid_t& declName, bool nameAllowed, bool nameRequired, bool& reportFailure) { int ptrCounter = 0; while (accept('*')) { ptrCounter++; pType = createType(TY_POINTER, pType, NULL); } pType = acceptDecl3(pType, declName, nameAllowed, nameRequired, reportFailure); while (ptrCounter-- > 0) { pType = createType(TY_POINTER, pType, NULL); } return pType; } Loading
libacc/tests/data/assignmentop.c +2 −6 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ void testAssignment() { printf("16|= 1 %d\n", a); } /* Can't use because int* f() is not parsed as a function decl. int a; int* f() { Loading @@ -43,24 +42,21 @@ int* f() { void testEval() { a = 0; printf("*f() = *f() + 10;"); printf("*f() = *f() + 10;\n"); *f() = *f() + 10; printf("a = %d\n", a); } void testOpEval() { a = 0; printf("*f() += 10;"); printf("*f() += 10;\n"); *f() += 10; printf("a = %d\n", a); } */ int main() { testAssignment(); /* testEval(); testOpEval(); */ return 0; }
libacc/tests/test.py +7 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,13 @@ result: 0""", """2 *= 5 10 17&= 1 1 17^= 1 16 16|= 1 17 *f() = *f() + 10; f() f() a = 10 *f() += 10; f() a = 10 """) def testcomma(self): Loading