1- /+ +
1+ /+ DO NOT EDIT BY HAND!
22This module was automatically generated from the following grammar:
33
44
@@ -109,7 +109,7 @@ TKNString <- (&'q{' ('q' NestedList('{',DString,'}')))
109109
110110DLMString <- ('q' doublequote) ( (&'{' NestedList('{',DString,'}'))
111111 / (&'[' NestedList('[',DString,']'))
112- / (&'$(LPAREN) ' NestedList('(',DString,')'))
112+ / (&'( ' NestedList('(',DString,')'))
113113 / (&'<' NestedList('<',DString,'>'))
114114 ) doublequote
115115
@@ -137,14 +137,12 @@ public import pegged.peg;
137137import std.algorithm : startsWith;
138138import std.functional : toDelegate;
139139
140- @safe :
141-
142- struct GenericPegged (TParseTree)
140+ @safe struct GenericPegged(TParseTree)
143141{
144142 import std.functional : toDelegate;
145143 import pegged.dynamic.grammar;
146144 static import pegged.peg;
147- @safe struct Pegged
145+ struct Pegged
148146 {
149147 enum name = " Pegged" ;
150148 static ParseTree delegate (ParseTree) @safe [string ] before;
@@ -209,7 +207,7 @@ struct GenericPegged(TParseTree)
209207
210208 template hooked (alias r, string name)
211209 {
212- static ParseTree hooked (ParseTree p)
210+ static ParseTree hooked (ParseTree p) @safe
213211 {
214212 ParseTree result;
215213
@@ -228,13 +226,13 @@ struct GenericPegged(TParseTree)
228226 return result;
229227 }
230228
231- static ParseTree hooked (string input)
229+ static ParseTree hooked (string input) @safe
232230 {
233231 return hooked! (r, name)(ParseTree(" " ,false ,[],input));
234232 }
235233 }
236234
237- static void addRuleBefore (string parentRule, string ruleSyntax)
235+ static void addRuleBefore (string parentRule, string ruleSyntax) @safe
238236 {
239237 // enum name is the current grammar name
240238 DynamicGrammar dg = pegged.dynamic.grammar.grammar(name ~ " : " ~ ruleSyntax, rules);
@@ -244,19 +242,19 @@ struct GenericPegged(TParseTree)
244242 before[parentRule] = rules[dg.startingRule];
245243 }
246244
247- static void addRuleAfter (string parentRule, string ruleSyntax)
245+ static void addRuleAfter (string parentRule, string ruleSyntax) @safe
248246 {
249247 // enum name is the current grammar named
250248 DynamicGrammar dg = pegged.dynamic.grammar.grammar(name ~ " : " ~ ruleSyntax, rules);
251- foreach (name ,rule; dg.rules)
249+ foreach (ruleName ,rule; dg.rules)
252250 {
253- if (name != " Spacing" )
254- rules[name ] = rule;
251+ if (ruleName != " Spacing" )
252+ rules[ruleName ] = rule;
255253 }
256254 after[parentRule] = rules[dg.startingRule];
257255 }
258256
259- static bool isRule (string s)
257+ static bool isRule (string s) pure nothrow @nogc
260258 {
261259 import std.algorithm : startsWith;
262260 return s.startsWith(" Pegged." );
0 commit comments