Opened 16 years ago
Closed 16 years ago
#223 closed defect (invalid)
Parser error with pointer manipulation in .mmp file
| Reported by: | dfix | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | Release 1.0 |
| Component: | examples | Version: | 1.0 |
| Keywords: | Parser, .mmp, pointer | Cc: |
Description
Line 14 gives a parser error, shown below. This same code executes in C.
typedef struct Node{
struct Node* next;
int value;
} Node;
void main () {
Node a1;
a1.value = 4;
assert a1.value == 4;
Node *p1 = &a1;
assert p1->value == 4;
}
line 14:10 mismatched input '=' expecting SEMI
examples/linkedList/linkedListSimple.mmp parsed unsuccessfully.
Note:
See TracTickets
for help on using tickets.

Problem is the declaration is not at the top of the function body. In MiniMP programs, all declarations must come first. So
should work.