perf(tags parser): improuve parser perf
This commit is contained in:
parent
d82620d1ff
commit
626b28ca16
2 changed files with 6 additions and 25 deletions
|
@ -41,11 +41,11 @@ module TagsSubstitutionConcern
|
|||
end
|
||||
|
||||
define_combinator :tag_text_first_char do
|
||||
any_char.that_fail(lit('-') | tag_delimiter | eol)
|
||||
any_char.that_fail(lit('-') | tag_delimiter)
|
||||
end
|
||||
|
||||
define_combinator :tag_text_char do
|
||||
any_char.that_fail(tag_delimiter | eol)
|
||||
any_char.that_fail(tag_delimiter)
|
||||
end
|
||||
|
||||
define_combinator :tag_text do
|
||||
|
@ -53,10 +53,6 @@ module TagsSubstitutionConcern
|
|||
str.force_encoding('utf-8').encode.gsub(/[[:space:]]/, ' ')
|
||||
end
|
||||
end
|
||||
|
||||
define_combinator :eol do
|
||||
lit("\r\n") | lit("\n")
|
||||
end
|
||||
end
|
||||
|
||||
DOSSIER_TAGS = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue