Misleading error message

Hi all:

I was tinkering with the sumstats code, and inadvertantly deleted the final “}” closing out the last function. When running the code, the misleading error message is received:

error in /Users/melland/traces/bro/share/bro/base/frameworks/tunnels/./main.bro, line 8: syntax error, at or near “module”

presumably due to the function still being open when the next policy script is loaded. Wouldn’t it be more reasonable to check at the end of each script when loaded that there are no dangling functions, expressions, etc. ???

Jim Mellander
ESNet

Yes, it's definitely reasonable to want a better error message here
and I don't think it would be that difficult to change the parser to
track the necessary state to emit a better message. Feel free to file
a ticket/bug.

- Jon