Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

NRE on empty grammar fixed.

  • Loading branch information...
commit 3a021fb83bcc563552154f962db809e9e6f8dfa7 1 parent 3a15f89
@rampelstinskin authored
Showing with 11 additions and 0 deletions.
  1. +2 −0  Nemerle.Parser.Macro/GrammarParser/ParseGrammar.n
  2. +9 −0 Test/Main.n
View
2  Nemerle.Parser.Macro/GrammarParser/ParseGrammar.n
@@ -19,6 +19,8 @@ namespace Nemerle.Parser
| MacroCall(name, _ns, [SyntaxElement.RawToken(LooseGroup(BracesGroup(tokens, _)))]) => // Name * NamespaceTree.Node * list [SyntaxElement]
if (name.Id != "grammar")
ReportCriticalUnexpected(rules, "grammar { ... }")
+ else if (tokens == null)
+ Grammar()
else
ParseGramar(Grammar(), tokens)
| rule => ReportCriticalUnexpected(rule, "grammar { ... }")
View
9 Test/Main.n
@@ -61,6 +61,15 @@ public abstract class IncParser
{
}
+[ParserGrammar(Options = EmitDebugSources,
+ grammar
+ {
+ }
+)]
+public abstract class EmptyParser
+{
+}
+
module Program
{
Main() : void
Please sign in to comment.
Something went wrong with that request. Please try again.