All files / mframejs/binding/ast charcode.ts

100% Statements 16/16
100% Branches 0/0
100% Functions 6/6
100% Lines 12/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 34 35          29x                   29x 87x   29x 87x   29x 29x 696x   29x 290x   29x 406x          
 
/**
 * class that holds all typoes of char types tokenizer need to know
 *
 */
export class CharCodes {
    public readonly WHITESPACE: Set<number>;
    public readonly OPERATOR: Set<number>;
    public readonly STRING_START_END: Set<number>;
    public readonly NUMBER: Set<number>;
    public readonly OPERATOR_COMBO: Set<string>;
 
 
 
    constructor() {
        this.WHITESPACE = new Set();
        [32, 10, 13].map(a => this.WHITESPACE.add(a));
 
        this.STRING_START_END = new Set();
        ["'", '"', '`'].map(a => this.STRING_START_END.add(a.charCodeAt(0)));
 
        this.OPERATOR = new Set();
        ['=', '!', '>', '<', '+', '-', '*', '/', '%', '@',
            '^', '(', ')', '|', '&', '?', ':', ',', '{', , '}', '[', ']', '$', '.'].map(a => this.OPERATOR.add(a.charCodeAt(0)));
 
        this.NUMBER = new Set();
        ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'].map(a => this.NUMBER.add(a.charCodeAt(0)));
 
        this.OPERATOR_COMBO = new Set();
        ['===', '==', '+=', '-=', '*=', '/=', '!=', '&&', '||', '!==', '>=', '<=', '${', '@{'].map(a => this.OPERATOR_COMBO.add(a));
 
    }
 
}