Build error with a comment just before the end of a grammar file
See original GitHub issueHi guys! I’m afraid I’ve found a bug.
Last lines in grammar.ne:
...
_ -> %__:? {% nuller %}
# --- //terminals ---
Build error (I’m using nearley-template btw):
[build] C:\new_projects\extensions\elm-ast\node_modules\nearley\lib\compile.js:25
for (var i = 0; i < structure.length; i++) {
^
TypeError: Cannot read property 'length' of undefined
at Compile (C:\new_projects\extensions\elm-ast\node_modules\nearley\lib\compile.js:25:39)
at StreamWrapper.<anonymous> (C:\new_projects\extensions\elm-ast\node_modules\nearley\bin\nearleyc.js:57:17)
at emitNone (events.js:110:20)
at StreamWrapper.emit (events.js:207:7)
at finishMaybe (_stream_writable.js:604:14)
at endWritable (_stream_writable.js:612:3)
at StreamWrapper.Writable.end (_stream_writable.js:563:5)
at ReadStream.onend (_stream_readable.js:595:10)
at Object.onceWrapper (events.js:312:30)
at emitNone (events.js:110:20)
[build] [nodemon] app crashed - waiting for file changes before starting...
When I delete that last comment from grammar.ne, everything works.
My SW:
node -v
=> v8.8.1npm -v
=> 5.6.0nearleyc -v
=> 2.11.1- Windows 10
Very nice project, I’ve just found it today and I am trying to write parser for Elm, thanks 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Fix Compile Error: Expected: End of Statement - VBA ...
The compile error occurs when you try to run the code and VBA identifies that something is missing. Run Time Errors. Runtime errors...
Read more >Error Explanations for The W3C Markup Validation Service
This error may appear if you are using a bad syntax for your comments, such as "<!invalid comment>" The proper syntax for comments...
Read more >No grammar constraints (DTD or XML schema) detected for ...
I had to make sure that the "manual" box as well as the "build" box was checked and then do a manual validate...
Read more >Common Grammar Mistakes: 11 Goofs You Might Know Too ...
It's time to review some common grammar mistakes that damage our credibility. Not normally a fun task, but absolutely necessary.
Read more >Using [sic] Properly
Sic is a Latin term meaning “thus.” It is used to indicate that something incorrectly written is intentionally being left as it was...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tjvr No, it’s low prio. You can leave it to me, I’ll try to send PR, thanks 😃
\n is how you tell nearley that you are done with the comment. In any case, I think all files should be \n-terminated. If you
cat
a non-newline-terminated file, it messes up your prompt! (You can configure your editor to do \n-terminate if it doesn’t already.)