<commit_before>import { Widget, Rect } from './Widget.ts';
import { Symbol } from './Symbol.ts';
import { DockingPoint } from "./DockingPoint.ts";

/**
 * Binary operations, such as plus and minus.
 *
 * BE EXTRA CAREFUL with the minus sign: use "−" (U+2212), not just a dash.
 */
export
class BinaryOperation extends Widget {
    protected s: any;
    protected operation: string;

    get typeAsString(): string {
        return "BinaryOperation";
    }

    /**
     * There's a thing with the baseline and all that... this sort-of fixes it.
     *
     * @returns {Vector} The position to which a Symbol is meant to be docked from.
     */
    get dockingPoint(): p5.Vector {
        var p = this.p.createVector(0, -this.s.xBox.h/2);
        return p;
    }

    constructor(p: any, s: any, operation: string) {
        super(p, s);
        this.s = s;
        this.operation = operation;

        // FIXME Not sure this is entirely right. Maybe make the "type" in DockingPoint an array? Works for now.
        this.docksTo = ['operator', 'symbol'];
    }

    /**
     * Generates all the docking points in one go and stores them in this.dockingPoints.<commit_msg>Now you can have e^{-x}.<commit_after>import { Widget, Rect } from './Widget.ts';
import { Symbol } from './Symbol.ts';
import { DockingPoint } from "./DockingPoint.ts";

/**
 * Binary operations, such as plus and minus.
 *
 * BE EXTRA CAREFUL with the minus sign: use "−" (U+2212), not just a dash.
 */
export
class BinaryOperation extends Widget {
    protected s: any;
    protected operation: string;

    get typeAsString(): string {
        return "BinaryOperation";
    }

    /**
     * There's a thing with the baseline and all that... this sort-of fixes it.
     *
     * @returns {Vector} The position to which a Symbol is meant to be docked from.
     */
    get dockingPoint(): p5.Vector {
        var p = this.p.createVector(0, -this.s.xBox.h/2);
        return p;
    }

    constructor(p: any, s: any, operation: string) {
        super(p, s);
        this.s = s;
        this.operation = operation;

        // FIXME Not sure this is entirely right. Maybe make the "type" in DockingPoint an array? Works for now.
        this.docksTo = ['operator', 'exponent', 'symbol'];
    }

    /**
     * Generates all the docking points in one go and stores them in this.dockingPoints.
{'fraction_non_alphanumeric': 0.12113511224057602, 'fraction_numerical': 0.005929690808979246, 'mean_word_length': 2.443148688046647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '956839', 'n_tokens_mistral': 735, 'n_tokens_neox': 704, 'n_words': 268}