All files / parser/nodes tuple.js

75% Statements 3/4
100% Branches 0/0
50% Functions 1/2
75% Lines 3/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                      14x     14x     14x              
import Node from './node';
 
/**
 * Matches an tuple literal.
 * 
 * This matches a tuple literal.
 */
export default class Tuple extends Node {
    
    /**
     * Creates a wrapper for tuples
     * 
     * @param {array} tuple the literal tuple value of the literal
     * @param {number} type The literal type as from a TokenType
     * @param {Object} position a position from nearley
     */
    constructor (tuple: array, type: number, position: Object) {
        // TODO: remember a tuple has multiple types, we need to implement that
        
        super(position);
        
        /** @type {array} */
        this.tuple = tuple;
        
        /** @type {VSLTokenType} */
        this.type = type;
    }
    
    /** @override */
    get children() {
        return null;
    }
}