Permalink
Browse files

Add `{` to unescpe list

  • Loading branch information...
1 parent 6263b82 commit a635d3b4b0a99dea5679a79f4b54baffa89a8bd2 @ixti ixti committed Jan 4, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 README.md
  2. +1 −1 lib/babelfish/parser.js
  3. +3 −3 test/parser-test.js
View
@@ -22,7 +22,7 @@ example:
#### Escape chars
-We support escaping (with backslash) of `#`, `%`, `|`, `\` and `}`.
+We support escaping (with backslash) of `#`, `%`, `|`, `\`, `{` and `}`.
#### Example with YAML
View
@@ -54,7 +54,7 @@ var MACROS_REGEXP = new RegExp(
);
// used to unescape critical chars
-var UNESCAPE_CHARS = new RegExp('\\\\([#%}|\\\\])', 'g');
+var UNESCAPE_CHARS = new RegExp('\\\\([#%}{|\\\\])', 'g');
function unescapeString(str) {
return str.replace(UNESCAPE_CHARS, '$1');
}
View
@@ -71,9 +71,9 @@ require('vows').describe('BabelFish.Parser').addBatch({
new PluralNode('c', ['a', 'b'])
],
- 'Plurals with %{a\\}b\\|c|d}:myvar, escaping': [
+ 'Plurals with %{a\\}b\\|c\\{d|e}:myvar, escaping': [
new ScalarNode('Plurals with '),
- new PluralNode('myvar', ['a}b|c', 'd']),
+ new PluralNode('myvar', ['a}b|c{d', 'e']),
new ScalarNode(', escaping')
],
@@ -231,7 +231,7 @@ require('vows').describe('BabelFish.Parser').addBatch({
});
},
- 'mathes first valid name': function (re) {
+ 'matches first valid name': function (re) {
regExpMatch('Jožin', ['Jo', 'Jo'])(re);
regExpMatch('.foobar', ['foobar', 'foobar'])(re);
regExpMatch('foobar.', ['foobar', 'foobar'])(re);

0 comments on commit a635d3b

Please sign in to comment.