You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
468 B
30 lines
468 B
2 years ago
|
import InputNode from './InputNode.js';
|
||
|
|
||
|
class ConstNode extends InputNode {
|
||
|
|
||
|
constructor( value, nodeType = null ) {
|
||
|
|
||
|
super( value, nodeType );
|
||
|
|
||
|
this.isConstNode = true;
|
||
|
|
||
|
}
|
||
|
|
||
|
generateConst( builder ) {
|
||
|
|
||
|
return builder.getConst( this.getNodeType( builder ), this.value );
|
||
|
|
||
|
}
|
||
|
|
||
|
generate( builder, output ) {
|
||
|
|
||
|
const type = this.getNodeType( builder );
|
||
|
|
||
|
return builder.format( this.generateConst( builder ), type, output );
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
export default ConstNode;
|