swift-pattern-compiler
Version:
A compiler which transforms SWIFT patterns to an object representation with additional information's.
14 lines (13 loc) • 403 B
TypeScript
import { IToken } from "./interfaces";
/**
* The tokenizer accepts a SWIFT field pattern and returns an array of tokens.
*
* ```
* const tokens = tokenizer("35a");
* // => [{ type: "num", value: "35" }, { type: "char", value: "a" }]
* ```
*
* @param input the SWIFT field pattern string
* @returns the tokens array
*/
export declare const tokenizer: (input: string) => IToken[];