regexper-static/src/js/parser/javascript/literal.js

29 lines
500 B
JavaScript
Raw Normal View History

import _ from 'lodash';
export default {
type: 'literal',
_render() {
2014-12-20 02:35:03 +00:00
return this.renderLabel(['"', this.literal, '"'])
.tap(label => {
2014-12-15 03:17:59 +00:00
var spans = label.selectAll('tspan');
spans[0].addClass('quote');
spans[2].addClass('quote');
2014-12-13 18:42:55 +00:00
label.select('rect').attr({
rx: 3,
ry: 3
});
2014-12-11 00:23:14 +00:00
});
},
2014-12-17 19:56:02 +00:00
merge(other) {
2014-12-20 02:35:03 +00:00
this.literal += other.literal;
2014-12-17 19:56:02 +00:00
},
setup() {
2014-12-20 02:35:03 +00:00
this.literal = this.properties.literal.textValue;
}
};