@octopusdeploy/ocl
Advanced tools
Comparing version 0.0.5 to 0.0.6
# Changelog | ||
### [0.0.6](https://www.github.com/OctopusDeploy/ocl.ts/compare/v0.0.5...v0.0.6) (2021-10-25) | ||
### Bug Fixes | ||
* parsing empty blocks incorrectly ([c19b89e](https://www.github.com/OctopusDeploy/ocl.ts/commit/c19b89e27d94ed8593130a068967a4a3ce2e0b5b)) | ||
### [0.0.5](https://www.github.com/OctopusDeploy/ocl.ts/compare/v0.0.4...v0.0.5) (2021-10-25) | ||
@@ -4,0 +11,0 @@ |
@@ -25,7 +25,9 @@ "use strict"; | ||
} | ||
this.currentToken = this.tokens[this.pc]; | ||
else { | ||
this.currentToken = this.tokens[this.pc]; | ||
} | ||
}; | ||
Parser.prototype.peekToken = function (i) { | ||
if (i === void 0) { i = 1; } | ||
if (this.pc + i >= this.tokens.length) { | ||
if (this.pc + i >= this.tokens.length - 1) { | ||
return this.tokens[this.tokens.length - 1]; | ||
@@ -230,8 +232,15 @@ } | ||
this.nextToken(); | ||
this.nextToken(); | ||
if (this.currentToken.tokenType === token_1.TokenType.NEW_LINE) { | ||
this.nextToken(); | ||
} | ||
else if (this.currentToken.tokenType !== token_1.TokenType.CLOSE_BRACKET) { | ||
} | ||
var block = []; | ||
while (![token_1.TokenType.CLOSE_BRACKET, token_1.TokenType.EOF].includes(this.peekToken().tokenType)) { | ||
while (![token_1.TokenType.CLOSE_BRACKET, token_1.TokenType.EOF].includes(this.peekToken().tokenType) && | ||
![token_1.TokenType.CLOSE_BRACKET, token_1.TokenType.EOF].includes(this.currentToken.tokenType)) { | ||
block.push(this.nextNode()); | ||
} | ||
this.nextToken(); | ||
if (![token_1.TokenType.CLOSE_BRACKET, token_1.TokenType.EOF].includes(this.currentToken.tokenType)) { | ||
this.nextToken(); | ||
} | ||
var blockEnd = this.currentToken; | ||
@@ -268,3 +277,3 @@ this.nextToken(); | ||
Parser.prototype.createAST = function () { | ||
while (this.currentToken !== undefined && this.currentToken.tokenType !== token_1.TokenType.EOF) { | ||
while (this.currentToken.tokenType !== token_1.TokenType.EOF) { | ||
this.ast.push(this.nextNode()); | ||
@@ -271,0 +280,0 @@ } |
@@ -44,3 +44,3 @@ { | ||
"types": "dist/index.d.ts", | ||
"version": "0.0.5" | ||
"version": "0.0.6" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43259
691