[ruby-core:72651] [Ruby trunk - Feature #11936] Allow ERB subclass to add token easily

From: takashikkbn@...
Date: 2016-01-01 11:06:15 UTC
List: ruby-core #72651
Issue #11936 has been updated by Takashi Kokubun.

File 0001-Allow-ERB-subclass-to-add-token-easily.patch added

I fixed a patch to reduce times to compile the same regexp in TrimScanner.

----------------------------------------
Feature #11936: Allow ERB subclass to add token easily
https://bugs.ruby-lang.org/issues/11936#change-55902

* Author: Takashi Kokubun
* Status: Open
* Priority: Normal
* Assignee: Masatoshi Seki
----------------------------------------
While I want to use ERB in Rails, escape token "<%==" is not available in ERB and we can't add a new token to ERB easily.
To allow ERB subclass to add a new token easily, I splitted ERB::Compiler#compile to some small methods and created ERB::Compiler::Scanner#stags and ERB::Compiler::Scanner#etags.

With this patch, we'll be able to add a new stag or etag by overriding these methods.
sample.rb is a sample to create ERB subclass with "<%==" token.

---Files--------------------------------
0001-Allow-ERB-subclass-to-add-token-easily.patch (8.4 KB)
sample.rb (882 Bytes)
0001-Allow-ERB-subclass-to-add-token-easily.patch (8.98 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next