Changing names of grammar elements.

Starting with an "_" will prevent collisions with extensions
This commit is contained in:
Jeff Avallone 2014-12-02 19:59:10 -05:00
parent 9609b1d5b7
commit 1ffcd785f8
3 changed files with 8 additions and 6 deletions

View File

@ -1,7 +1,9 @@
grammar JavascriptRegexp grammar JavascriptRegexp
root <- ( ( "/" regexp "/" fl:[igm]* ) / regexp ""? ) <Root> root <- ( ( "/" regexp "/" _flags:[igm]* ) / regexp ""? ) <Root>
regexp <- match alternates:( "|" match )* <Regexp> regexp <- _match:match _alternates:( "|" match )* <Regexp>
match <- anchor_start? ( ( subexp / charset / terminal ) repeat? )* anchor_end? <Match> match <- _anchor_start:anchor_start?
_parts:( ( subexp / charset / terminal ) repeat? )*
_anchor_end:anchor_end? <Match>
anchor_start <- "^" anchor_start <- "^"
anchor_end <- "$" anchor_end <- "$"
repeat <- ( repeat_any / repeat_required / repeat_optional / repeat_spec ) repeat_greedy? repeat <- ( repeat_any / repeat_required / repeat_optional / repeat_spec ) repeat_greedy?

View File

@ -60,6 +60,6 @@ export default _.extend({}, Base, {
}, },
matches() { matches() {
return [this.match].concat(_.map(this.alternates.elements, _.property('match'))); return [this._match].concat(_.map(this._alternates.elements, _.property('match')));
} }
}); });

View File

@ -33,8 +33,8 @@ export default _.extend({}, Base, {
flags() { flags() {
var flags; var flags;
if (this.fl) { if (this._flags) {
flags = this.fl.textValue; flags = this._flags.textValue;
} else { } else {
flags = ''; flags = '';
} }