Closed christopher-haueter closed 11 years ago
comments are a lexer thing, shouldn't be related to the grammar in any way. keep in mind a comment goes from the # till the end of the line. Mind sharing the code that's not working?
On Thu, May 9, 2013 at 4:17 PM, Chris Haueter notifications@github.comwrote:
@mnrubin https://github.com/mnrubin @meirf https://github.com/meirf
— Reply to this email directly or view it on GitHubhttps://github.com/etanzapinsky/mongoose/issues/13 .
This works:
environment{
int[2][2] x
x[1][1] = 3
print(x[1][1])
# spurious comment
action{
}
populate{
}
}
terminate{
}
analysis{
}
This does not:
environment{
int[2][2] x
x[1][1] = 3
print(x[1][1])
# spurious comment
action{
}
populate{
}
}
terminate{
}
analysis{
}
it's possible that the issue is related to the newline/statement_list bug that Etan just caught and fixed. Try again when he pushes the bugfix. I doubt it's specific to the environment block, and prob has to do with the newline
Still breaks for me:
environment{
int[2][3] x
x[1][1] = 1
print(x[1][1])
x[1][2] = 2
print(x[1][2])
int y = x[1][1]
print(y)
# comment
action{
}
populate{
}
}
terminate{
}
analysis{
}
Yields:
(plt)➜ mongoose git:(dev) ✗ ./manage.sh parser/main.py sample_code/list_declaration_and_access.mon
LexToken(NEWLINE,'\n',10,123)
Syntax error in input:
Input: LexToken(NEWLINE,'\n',10,123)
Syntax error in input: program order must be: [agents] environment terminate analysis
result is of type <type 'NoneType'>
done
@meirf @mnrubin
what do you mean by "it breaks" ? What type of error are you getting?
On Thu, May 9, 2013 at 5:39 PM, Chris Haueter notifications@github.comwrote:
Still breaks for me:
environment{ int[2][3] x x[1][1] = 1 print(x[1][1]) x[1][2] = 2 print(x[1][2]) int y = x[1][1] print(y)
comment
action{ } populate{ }
}
terminate{ } analysis{ }
@etanzapinsky https://github.com/etanzapinsky
— Reply to this email directly or view it on GitHubhttps://github.com/etanzapinsky/mongoose/issues/13#issuecomment-17691642 .
@mnrubin look again
ah, sorry, that last bit didn't show up in the github email. I'll take a look tomorrow, at this point our errors are a bit general so it may be hard to tell what the problem is exactly, but it has something to do with the newlines I'd wager. Meir and I will fix it, thanks for finding the bug
This worked without problems (we just ran it). Are you still getting a bug @chrishaum ?
I haven't seen it again.
@mnrubin @meirf