2014-11-30 19:10:27 +00:00
|
|
|
import _ from 'lodash';
|
|
|
|
import Base from './base.js';
|
2014-11-30 15:48:33 +00:00
|
|
|
|
2014-11-30 19:10:27 +00:00
|
|
|
export default _.extend({}, Base, {
|
2014-11-26 23:24:40 +00:00
|
|
|
flags() {
|
|
|
|
var flags;
|
|
|
|
|
|
|
|
if (this.fl) {
|
|
|
|
flags = this.fl.textValue;
|
|
|
|
} else {
|
|
|
|
flags = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
global: /g/.test(flags),
|
|
|
|
ignore_case: /i/.test(flags),
|
|
|
|
multiline: /m/.test(flags)
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
expression() {
|
|
|
|
if (this.regexp) {
|
|
|
|
return this.regexp;
|
|
|
|
} else {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
2014-11-30 19:10:27 +00:00
|
|
|
});
|