Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Nov 25, 2021
1 parent 0ebac47 commit e43b212
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/tokenize/lexicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export enum Lexicon {
EOF,
}

export const LEXICON: ReadonlyMap<Lexicon, string | string[] | null> = new Map<
export type LexiconType = ReadonlyMap<Lexicon, string | string[] | null>;

export const LEXICON: LexiconType = new Map<
Lexicon,
string | string[] | null
>([
Expand Down
4 changes: 2 additions & 2 deletions lib/tokenize/tokenize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LEXICON, Lexicon } from "./lexicon.ts";
import { LEXICON, Lexicon, LexiconType } from "./lexicon.ts";
import { Token } from "./token.ts";
import { findInLexicon } from "./utils.ts";

Expand Down Expand Up @@ -40,7 +40,7 @@ const INITIAL_TOKENIZATION_STATE: Readonly<TokenizationState> = Object.freeze({

export function* tokenize(
input: string,
lex: ReadonlyMap<Lexicon, string | string[] | null> = LEXICON,
lex: LexiconType = LEXICON,
): FartTokenGenerator {
const memo = { ...INITIAL_TOKENIZATION_STATE };

Expand Down
4 changes: 2 additions & 2 deletions lib/tokenize/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Lexicon } from "./lexicon.ts";
import { Lexicon, LexiconType } from "./lexicon.ts";

export const findInLexicon = (
raw: string | null,
lex: ReadonlyMap<Lexicon, string | string[] | null>,
lex: LexiconType,
): Lexicon | null => {
if (raw === null) return null;
for (const [kind, value] of lex) {
Expand Down

1 comment on commit e43b212

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on e43b212 Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

failed to fetch 'https://raw.githubusercontent.com/EthanThatOneKid/fart/e43b212fbb079453620cfdf877e633ff61fad0ef/std/server/worker.ts': HTTP status client error (404 Not Found) for url (https://raw.githubusercontent.com/EthanThatOneKid/fart/e43b212fbb079453620cfdf877e633ff61fad0ef/std/server/worker.ts)

Please sign in to comment.