Changing names of grammar elements.
Starting with an "_" will prevent collisions with extensions
This commit is contained in:
parent
9609b1d5b7
commit
1ffcd785f8
@ -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?
|
||||||
|
@ -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')));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -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 = '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user