mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
52
react-app/node_modules/babel-generator/lib/position.js
generated
vendored
Normal file
52
react-app/node_modules/babel-generator/lib/position.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Track current position in code generation.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
var _classCallCheck = require("babel-runtime/helpers/class-call-check")["default"];
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var Position = (function () {
|
||||
function Position() {
|
||||
_classCallCheck(this, Position);
|
||||
|
||||
this.line = 1;
|
||||
this.column = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a string to the current position, mantaining the current line and column.
|
||||
*/
|
||||
|
||||
Position.prototype.push = function push(str) {
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (str[i] === "\n") {
|
||||
this.line++;
|
||||
this.column = 0;
|
||||
} else {
|
||||
this.column++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Unshift a string from the current position, mantaining the current line and column.
|
||||
*/
|
||||
|
||||
Position.prototype.unshift = function unshift(str) {
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (str[i] === "\n") {
|
||||
this.line--;
|
||||
} else {
|
||||
this.column--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return Position;
|
||||
})();
|
||||
|
||||
exports["default"] = Position;
|
||||
module.exports = exports["default"];
|
Reference in New Issue
Block a user