Skip to content

Commit

Permalink
Moved LanguageFlags setting into grammar file; and
Browse files Browse the repository at this point in the history
automatically insert LF before EOF.
  • Loading branch information
pgeerkens committed May 10, 2016
1 parent c43155a commit 3b902bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions QABCIronyParser/QabcGrammar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//#define KeySpec
using System;
using System.Collections.Generic;
using Irony.Parsing;

using PGSoftwareSolutionsInc.PGIrony;
using PGSoftwareSolutionsInc.Music;
Expand Down Expand Up @@ -159,6 +160,8 @@ public QabcGrammar() : base(false) {
new List<Irony.Parsing.Terminal>() {Tempo,Length,Octave,Shift}
);
#endregion 4-Color Highlighting

LanguageFlags = LanguageFlags.CreateAst | LanguageFlags.NewLineBeforeEOF;
}

/// <summary>Whitespace is part of this grammar, so we override the routine that skips it.</summary>
Expand Down
1 change: 0 additions & 1 deletion QABCIronyParser/QabcIronyParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public QabcIronyParser() : base(new QabcGrammar()) {}
ParseTree _parseTree;
if (GCFirst) { _parseTree = null; GC.Collect(); }

Language.Grammar.LanguageFlags = LanguageFlags.CreateAst;
Parse(music, "<music>");
_parseTree = Context.CurrentParseTree;
Errors = _parseTree.ParserMessages;
Expand Down

0 comments on commit 3b902bc

Please sign in to comment.