Sha256: 95110826733015e290b0e0cff1e76a47a3189d57b6ca83999548f978717500f1

Contents?: true

Size: 1.24 KB

Versions: 23

Compression:

Stored size: 1.24 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _constants = require("../constants");

var _Node = _interopRequireDefault(require("./Node"));

var _Range = _interopRequireDefault(require("./Range"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

class BlankLine extends _Node.default {
  constructor() {
    super(_constants.Type.BLANK_LINE);
  }
  /* istanbul ignore next */


  get includesTrailingLines() {
    // This is never called from anywhere, but if it were,
    // this is the value it should return.
    return true;
  }
  /**
   * Parses blank lines from the source
   *
   * @param {ParseContext} context
   * @param {number} start - Index of first \n character
   * @returns {number} - Index of the character after this
   */


  parse(context, start) {
    this.context = context;
    const {
      src
    } = context;
    let offset = start + 1;

    while (_Node.default.atBlank(src, offset)) {
      const lineEnd = _Node.default.endOfWhiteSpace(src, offset);

      if (lineEnd === '\n') offset = lineEnd + 1;else break;
    }

    this.range = new _Range.default(start, offset);
    return offset;
  }

}

exports.default = BlankLine;

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.6 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.5 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.4 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.3 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.2 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.1 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.3.5 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-5.0.0 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.3.4 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.3.3 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.3.2 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.3.1 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.3 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.2.3 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.2.2 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.2.1 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.2 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.1.9 node_modules/yaml/dist/cst/BlankLine.js
trusty-cms-4.1.8 node_modules/yaml/dist/cst/BlankLine.js