Comparing version 0.10.3 to 0.10.4
@@ -0,1 +1,7 @@ | ||
## 0.10.4 (2020-09-15) | ||
### New features | ||
Parser objects now have a `withTokenizer` method that can be used to replace external tokenizers. | ||
## 0.10.3 (2020-09-10) | ||
@@ -2,0 +8,0 @@ |
@@ -1359,2 +1359,7 @@ import { Tree, NodeProp, NodeGroup, NodeType, DefaultBufferLength, TreeBuffer } from 'lezer-tree'; | ||
}; | ||
/// Replace the given external tokenizer with another one, returning | ||
/// a new parser object. | ||
Parser.prototype.withTokenizer = function (from, to) { | ||
return this.copy({ tokenizers: this.tokenizers.map(function (t) { return t == from ? to : t; }) }); | ||
}; | ||
Parser.prototype.copy = function (props) { | ||
@@ -1361,0 +1366,0 @@ // Hideous reflection-based kludge to make it easy to create a |
import { Stack } from "./stack"; | ||
import { InputStream, Token, Tokenizer } from "./token"; | ||
import { InputStream, Token, Tokenizer, ExternalTokenizer } from "./token"; | ||
import { Tree, TreeBuffer, NodeGroup, NodeType, NodePropSource } from "lezer-tree"; | ||
@@ -86,2 +86,3 @@ export declare type NestedGrammar = null | Parser | ((input: InputStream, stack: Stack) => NestedGrammarSpec); | ||
withProps(...props: NodePropSource[]): Parser; | ||
withTokenizer(from: ExternalTokenizer, to: ExternalTokenizer): Parser; | ||
private copy; | ||
@@ -88,0 +89,0 @@ getName(term: number): string; |
{ | ||
"name": "lezer", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "Incremental parser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
375788
3101