зеркало из https://github.com/mozilla/gecko-dev.git
Add support for the 'substitution' filter.
This commit is contained in:
Родитель
ec0c023645
Коммит
33203eae13
|
@ -4,7 +4,7 @@
|
|||
# Preprocessor
|
||||
# Version 1.0
|
||||
#
|
||||
# Copyright (c) 2002 by Ian Hickson
|
||||
# Copyright (c) 2002, 2003 by Ian Hickson
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,6 +20,8 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Thanks to bryner and bsmedberg for suggestions.
|
||||
|
||||
use strict;
|
||||
|
||||
# takes as arguments the files to process
|
||||
|
@ -414,4 +416,10 @@ sub slashslash {
|
|||
return $text;
|
||||
}
|
||||
|
||||
sub substitution {
|
||||
my($stack, $text) = @_;
|
||||
$text =~ s/@(\w+)@/$stack->get($1)/gose;
|
||||
return $text;
|
||||
}
|
||||
|
||||
########################################################################
|
||||
|
|
Загрузка…
Ссылка в новой задаче