Skip to content

Commit 9d7737d

Browse files
mvzvincent-psarga
authored andcommitted
Speed up detection of single curlies in template content
1 parent 36caa67 commit 9d7737d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/ruby-handlebars/parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ class Parser < Parslet::Parser
3030
rule(:eof) { any.absent? }
3131
rule(:template_content) {
3232
(
33+
nocurly | # Not a curly
3334
ocurly >> nocurly | # Opening curly that doesn't start a {{}}
34-
ocurly >> eof | # Opening curly that doesn't start a {{}} because it's the end
3535
ccurly | # Closing curly that is not inside a {{}}
36-
nocurly
36+
ocurly >> eof # Opening curly that doesn't start a {{}} because it's the end
3737
).repeat(1).as(:template_content) }
3838

3939
rule(:unsafe_replacement) { docurly >> space? >> path.as(:replaced_unsafe_item) >> space? >> dccurly }

0 commit comments

Comments
 (0)