diff options
author | Sami Vaarala <sami.vaarala@iki.fi> | 2014-02-11 17:14:59 +0200 |
---|---|---|
committer | Sami Vaarala <sami.vaarala@iki.fi> | 2014-02-11 17:14:59 +0200 |
commit | 2e3310f64ef45a859f375582a84c5d71febc041b (patch) | |
tree | 46b950112d69f6f0b7f09b0715100a99df3c1b3f | |
parent | ef1e46010f6547419301c519666a1aece49b92d1 (diff) |
escape curly braces in regexps for more portability (unescaped curly braces are technically a SyntaxError in Ecmascript E5/E5.1)
-rw-r--r-- | src/parseTools.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index bad080b7..fe56580e 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -162,7 +162,7 @@ function isArrayType(type) { function isStructType(type) { if (isPointerType(type)) return false; if (isArrayType(type)) return true; - if (/<?{ ?[^}]* ?}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types + if (/<?\{ ?[^}]* ?\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types // See comment in isStructPointerType() return type[0] == '%'; } @@ -172,7 +172,7 @@ function isVectorType(type) { } function isStructuralType(type) { - return /^{ ?[^}]* ?}$/.test(type); // { i32, i8 } etc. - anonymous struct types + return /^\{ ?[^}]* ?\}$/.test(type); // { i32, i8 } etc. - anonymous struct types } function getStructuralTypeParts(type) { // split { i32, i8 } etc. into parts |