gorillascript
gorillascript copied to clipboard
line breaks (\n) in long conditionals
It feels like something like this shouldn't break the gorilla compiler:
if e and (e.source != this.global or
e.origin != this.origin or e.data != this.token)
return
Yet I can't for the life of me figure out how to format a long conditional to under 80 cols and still have the gorilla compiler accept it.
Check out this question I asked awhile back: https://github.com/ckknight/gorillascript/issues/142 it should help you out.
Thanks. I'll check this out.
Sent from my iPhone
On Aug 11, 2014, at 8:52 AM, Kyle Kirby [email protected] wrote:
Check out this question I asked awhile back: #142 it should help you out.
— Reply to this email directly or view it on GitHub.
@kkirby, @ckknight;
The solution in #142 seems okay to get me past my current issue, but I'm sort of reluctant to close the issue because from a grammar and syntax point of view there doesn't seem to be any ambiguity...i.e, the 'newline' (or any whitespace really) should not be a syntactically significant character when it occurs inside an as yet unterminated conditional.
conditional -> value
conditional -> conditional operator (whitespace shouldn't have significance here...) conditional
//not ambiguous
if x and y and
z
//somewhat ambiguous
if x and y
and z
Edit. remove double negative in statement.
Yeah, I definitely don't disagree with you.
Yeah, the internals of the parser would need to be updated. I'm not against this happening, but I don't have the capacity right now to do it myself. I'm completely willing to accept a patch.