| 629 | |
| 630 | var savedInlineRE = []; |
| 631 | function inlineRE(endChar) { |
| 632 | if (!savedInlineRE[endChar]) { |
| 633 | // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741) |
| 634 | endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); |
| 635 | // Match any non-endChar, escaped character, as well as the closing |
| 636 | // endChar. |
| 637 | savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')'); |
| 638 | } |
| 639 | return savedInlineRE[endChar]; |
| 640 | } |
| 641 | |
| 642 | var mode = { |
| 643 | startState: function() { |