Finicky Grammar File Interpreter Requires Empty Line

I've noticed, once again, a rather pesky error that can show up in SRGS grammar files on Prophecy.

In an SRGS file, the top line in in the file is the xml declaration, and the next line in the file is the grammar element.

If the very next line is a comment, the grammar file will experience problems.

For example, I was debugging today and accidentally put a comment right after the grammar element. As a result, the grammar file would not return any interpretations. That is, if I set

<tag>$.answer = "foo"</tag>

in an item, the interpretation "answer" would not be returned.

To avoid this problem, put one blank line between the grammar element and the first comment.

I vaguely recall having other problems with comments in SRGS grammar files; if there are other elements or XML-related declerations at the top, the comments come afterwards. E.g., if there's a DOCTYPE declaration, you may have trouble if you place a comment between it and the grammar element. I recommend that you put comments after all top-of-file elements and declarations, just to be safe.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

A bug

I opened up a bug report 506242 to track this at voxeo. I expect it should be easy to fix in the next build. RJ