How to use the @bbob/plugin-helper/lib/char.getChar function in @bbob/plugin-helper

To help you get started, we’ve selected a few @bbob/plugin-helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
flushTag() {
    if (this.inTag()) {
      // [] and [=] tag case
      if (this.tagToken[Token.VALUE_ID] === '') {
        const value = this.inAttrValue() ? getChar(EQ) : '';
        const word = getChar(OPEN_BRAKET) + value + getChar(CLOSE_BRAKET);

        this.createWord('', 0, 0);
        this.wordToken[Token.VALUE_ID] += word;

        this.tagToken = this.dummyToken;

        if (this.inAttrValue()) {
          this.attrValueToken = this.dummyToken;
        }

        return;
      }

      if (this.inAttrName() && !this.inAttrValue()) {
        this.tagToken[Token.VALUE_ID] += PLACEHOLDER_SPACE + this.attrNameToken[Token.VALUE_ID];
        this.attrNameToken = this.dummyToken;
github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
flushTag() {
    if (this.inTag()) {
      // [] and [=] tag case
      if (this.tagToken[Token.VALUE_ID] === '') {
        const value = this.inAttrValue() ? getChar(EQ) : '';
        const word = getChar(OPEN_BRAKET) + value + getChar(CLOSE_BRAKET);

        this.createWord('', 0, 0);
        this.wordToken[Token.VALUE_ID] += word;

        this.tagToken = this.dummyToken;

        if (this.inAttrValue()) {
          this.attrValueToken = this.dummyToken;
        }

        return;
      }

      if (this.inAttrName() && !this.inAttrValue()) {
        this.tagToken[Token.VALUE_ID] += PLACEHOLDER_SPACE + this.attrNameToken[Token.VALUE_ID];
github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
charWORD(charCode) {
    if (this.inTag()) {
      if (this.inAttrValue()) {
        this.attrValueToken[Token.VALUE_ID] += getChar(charCode);
      } else if (this.inAttrName()) {
        this.attrNameToken[Token.VALUE_ID] += getChar(charCode);
      } else {
        this.tagToken[Token.VALUE_ID] += getChar(charCode);
      }
    } else {
      this.createWord();

      this.wordToken[Token.VALUE_ID] += getChar(charCode);
    }

    this.nextCol();
  }
github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
flushUnclosedTag() {
    if (this.inTag()) {
      const value = this.tagToken[Token.VALUE_ID] + (this.attrValueToken && this.attrValueToken[Token.VALUE_ID] ? getChar(EQ) : '');

      this.tagToken[Token.TYPE_ID] = Token.TYPE_WORD;
      this.tagToken[Token.VALUE_ID] = getChar(OPEN_BRAKET) + value;

      this.appendToken(this.tagToken);

      this.tagToken = this.dummyToken;

      if (this.inAttrValue()) {
        this.attrValueToken = this.dummyToken;
      }
    }
  }
github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
charEQ(charCode) {
    const nextCharCode = this.seekChar(1);
    const isNextQuotemark = nextCharCode === QUOTEMARK;

    if (this.inTag()) {
      this.attrValueToken = this.createAttrValueToken('');

      if (isNextQuotemark) {
        this.attrValueToken.quoted = true;
        this.skipChar(1);
      }
    } else {
      this.wordToken[Token.VALUE_ID] += getChar(charCode);
    }

    this.nextCol();
  }
github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
charN(charCode) {
    this.flushWord();
    this.appendToken(this.createNewLineToken(getChar(charCode)));

    this.nextLine();
    this.colPos = 0;
  }
github JiLiZART / bbob / packages / bbob-parser / lib / Tokenizer.js View on Github external
charCLOSEBRAKET(charCode) {
    const prevCharCode = this.seekChar(-1);
    const isPrevSpace = prevCharCode === SPACE || prevCharCode === TAB;

    if (isPrevSpace) {
      this.wordToken[Token.VALUE_ID] += getChar(charCode);
    }

    this.nextCol();
    this.flushTag();
    this.flushAttrNames();
    this.flushAttrs();
  }