otac0n / Pegasus

A PEG parser generator for .NET that integrates with MSBuild and Visual Studio.

Home Page:http://otac0n.com/Pegasus/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The "CompilePegGrammar" task failed unexpectedly.

david-pfx opened this issue · comments

Grammar line was:
DefArg = WSO '$' v:[0-9] #parse{ DefArg(v) }

Error info follows.
Error The "CompilePegGrammar" task failed unexpectedly.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List1.get_Item(Int32 index) at System.Collections.ObjectModel.ReadOnlyCollection1.System.Collections.Generic.IList.get_Item(Int32 index)
at Pegasus.Compiler.CodeGenerator.RenderSequence(Object model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderSequence(Object model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderSequence(Object model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderSequence(Object model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderSequence(Object model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderSequenceExpression(SequenceExpression model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.WalkSequenceExpression(SequenceExpression sequenceExpression)
at Pegasus.Compiler.ExpressionDispatch.<>c__DisplayClass0_0.b__0(Expression expression)
at Pegasus.Compiler.ExpressionTreeWalker.WalkExpression(Expression expression)
at Pegasus.Compiler.CodeGenerator.WalkRule(Rule rule, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderRule(Rule model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.WalkRule(Rule rule)
at Pegasus.Compiler.ExpressionTreeWalker.WalkGrammar(Grammar grammar)
at Pegasus.Compiler.CodeGenerator.WalkGrammar(Grammar grammar, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.RenderGrammar(Grammar model, TextWriter writer, String indentation)
at Pegasus.Compiler.CodeGenerator.WalkGrammar(Grammar grammar)
at Pegasus.Compiler.GenerateCodePass.Run(Grammar grammar, CompileResult result)
at Pegasus.Compiler.PegCompiler.Compile(Grammar grammar)
at Pegasus.CompileManager.CompileString(String subject, String fileName)
at Pegasus.CompileManager.CompileFile(String inputFile, String outputFile, Action`1 logError)
at Pegasus.CompilePegGrammar.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() Poly.Compiler

I can reproduce.