@helios-lang/compiler-utils
Advanced tools
Comparing version
{ | ||
"name": "@helios-lang/compiler-utils", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Helios language compiler library", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
import { None } from "@helios-lang/codec-utils" | ||
import { | ||
Comment, | ||
Group, | ||
@@ -61,5 +62,7 @@ Source, | ||
prev0 = prev1 | ||
prev1 = prev2 | ||
prev2 = t | ||
if (!Comment.from(t)) { | ||
prev0 = prev1 | ||
prev1 = prev2 | ||
prev2 = t | ||
} | ||
} | ||
@@ -66,0 +69,0 @@ |
export * from "./formatters/index.js"; | ||
export * from "./readers/index.js"; | ||
//# sourceMappingURL=index.d.ts.map |
export * from "./formatters/index.js" | ||
export * from "./readers/index.js" |
/** | ||
* @template T | ||
* @typedef {import("@helios-lang/codec-utils").Option<T>} Option | ||
*/ | ||
/** | ||
* @typedef {import("../errors/index.js").Site} Site | ||
@@ -9,2 +13,7 @@ */ | ||
/** | ||
* @param {any} token | ||
* @returns {Option<Comment>} | ||
*/ | ||
static from(token: any): Option<Comment>; | ||
/** | ||
* @param {string} value - includes the comment symbols | ||
@@ -18,4 +27,5 @@ * @param {Site} site | ||
} | ||
export type Option<T> = import("@helios-lang/codec-utils").Option<T>; | ||
export type Site = import("../errors/index.js").Site; | ||
export type Token = import("./Token.js").Token; | ||
//# sourceMappingURL=Comment.d.ts.map |
@@ -0,2 +1,9 @@ | ||
import { None } from "@helios-lang/codec-utils" | ||
/** | ||
* @template T | ||
* @typedef {import("@helios-lang/codec-utils").Option<T>} Option | ||
*/ | ||
/** | ||
* @typedef {import("../errors/index.js").Site} Site | ||
@@ -19,2 +26,10 @@ */ | ||
/** | ||
* @param {any} token | ||
* @returns {Option<Comment>} | ||
*/ | ||
static from(token) { | ||
return token instanceof Comment ? token : None | ||
} | ||
toString() { | ||
@@ -21,0 +36,0 @@ return this.value |
@@ -0,1 +1,2 @@ | ||
export { Comment } from "./Comment.js"; | ||
export { Group } from "./Group.js"; | ||
@@ -2,0 +3,0 @@ export { Source } from "./Source.js"; |
@@ -0,1 +1,2 @@ | ||
export { Comment } from "./Comment.js" | ||
export { Group } from "./Group.js" | ||
@@ -2,0 +3,0 @@ export { Source } from "./Source.js" |
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
93836
2.45%87
7.41%2998
2.11%