diff --git a/src/js/parser/javascript/grammar.peg b/src/js/parser/javascript/grammar.peg index c7311b6..f0eb426 100644 --- a/src/js/parser/javascript/grammar.peg +++ b/src/js/parser/javascript/grammar.peg @@ -1,7 +1,9 @@ grammar JavascriptRegexp - root <- ( ( "/" regexp "/" fl:[igm]* ) / regexp ""? ) - regexp <- match alternates:( "|" match )* - match <- anchor_start? ( ( subexp / charset / terminal ) repeat? )* anchor_end? + root <- ( ( "/" regexp "/" _flags:[igm]* ) / regexp ""? ) + regexp <- _match:match _alternates:( "|" match )* + match <- _anchor_start:anchor_start? + _parts:( ( subexp / charset / terminal ) repeat? )* + _anchor_end:anchor_end? anchor_start <- "^" anchor_end <- "$" repeat <- ( repeat_any / repeat_required / repeat_optional / repeat_spec ) repeat_greedy? diff --git a/src/js/parser/javascript/regexp.js b/src/js/parser/javascript/regexp.js index 97b6e2c..9b08a0d 100644 --- a/src/js/parser/javascript/regexp.js +++ b/src/js/parser/javascript/regexp.js @@ -60,6 +60,6 @@ export default _.extend({}, Base, { }, matches() { - return [this.match].concat(_.map(this.alternates.elements, _.property('match'))); + return [this._match].concat(_.map(this._alternates.elements, _.property('match'))); } }); diff --git a/src/js/parser/javascript/root.js b/src/js/parser/javascript/root.js index 3969101..960ec31 100644 --- a/src/js/parser/javascript/root.js +++ b/src/js/parser/javascript/root.js @@ -33,8 +33,8 @@ export default _.extend({}, Base, { flags() { var flags; - if (this.fl) { - flags = this.fl.textValue; + if (this._flags) { + flags = this._flags.textValue; } else { flags = ''; }