Sha256: 272ba6aba5feb43007856900f98771c93b600fa493a43226009a3cb099d55d33
Contents?: true
Size: 1.38 KB
Versions: 23
Compression:
Stored size: 1.38 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 Directive extends _Node.default { constructor() { super(_constants.Type.DIRECTIVE); this.name = null; } get parameters() { const raw = this.rawValue; return raw ? raw.trim().split(/[ \t]+/) : []; } parseName(start) { const { src } = this.context; let offset = start; let ch = src[offset]; while (ch && ch !== '\n' && ch !== '\t' && ch !== ' ') ch = src[offset += 1]; this.name = src.slice(start, offset); return offset; } parseParameters(start) { const { src } = this.context; let offset = start; let ch = src[offset]; while (ch && ch !== '\n' && ch !== '#') ch = src[offset += 1]; this.valueRange = new _Range.default(start, offset); return offset; } parse(context, start) { this.context = context; let offset = this.parseName(start + 1); offset = this.parseParameters(offset); offset = this.parseComment(offset); this.range = new _Range.default(start, offset); return offset; } } exports.default = Directive;
Version data entries
23 entries across 23 versions & 1 rubygems