Use recursion for parsing string bodies

This is a little bit faster than using the * operator combined with
Array#inject.
This commit is contained in:
Yorick Peterse 2015-04-15 00:49:40 +02:00
parent e942086f2d
commit 23a441933a
1 changed files with 2 additions and 1 deletions

View File

@ -189,7 +189,8 @@ string
;
string_body
= T_STRING_BODY* { val[0].inject(:+) || '' }
= T_STRING_BODY string_body { val[0] + val[1] }
| _ { '' }
;
%inner