edge-parser
Advanced tools
Comparing version 1.0.12 to 1.0.13
/** | ||
* @module Parser | ||
*/ | ||
import * as Contracts from 'edge-lexer/build/src/Contracts'; | ||
import { EdgeBuffer } from '../EdgeBuffer'; | ||
@@ -45,2 +46,6 @@ import { ITag, ILoc } from '../Contracts'; | ||
/** | ||
* Generates and returns AST tokens for a given template | ||
*/ | ||
generateTokens(template: string): Contracts.INode[]; | ||
/** | ||
* Process a token and writes the output to the buffer instance | ||
@@ -47,0 +52,0 @@ */ |
@@ -87,8 +87,13 @@ "use strict"; | ||
const buffer = new EdgeBuffer_1.EdgeBuffer(); | ||
const tokens = this.generateTokens(template); | ||
tokens.forEach((token) => (this.processToken(token, buffer))); | ||
return buffer.flush(wrapAsFunction); | ||
} | ||
/** | ||
* Generates and returns AST tokens for a given template | ||
*/ | ||
generateTokens(template) { | ||
const tokenizer = new edge_lexer_1.Tokenizer(template, this.tags); | ||
tokenizer.parse(); | ||
tokenizer.tokens.forEach((token) => { | ||
this.processToken(token, buffer); | ||
}); | ||
return buffer.flush(wrapAsFunction); | ||
return tokenizer.tokens; | ||
} | ||
@@ -95,0 +100,0 @@ /** |
@@ -0,1 +1,11 @@ | ||
<a name="1.0.13"></a> | ||
## [1.0.13](https://github.com/poppinss/edge-parser/compare/v1.0.12...v1.0.13) (2018-07-09) | ||
### Features | ||
* **parser:** expose generateTokens method to generate lexer tokens ([9c5073f](https://github.com/poppinss/edge-parser/commit/9c5073f)) | ||
<a name="1.0.12"></a> | ||
@@ -2,0 +12,0 @@ ## [1.0.12](https://github.com/poppinss/edge-parser/compare/v1.0.11...v1.0.12) (2018-07-09) |
{ | ||
"name": "edge-parser", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "Parser for edge template engine", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
35148
859