Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Dec 8, 2021
1 parent 5fc87f4 commit f8be624
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 143 deletions.
3 changes: 0 additions & 3 deletions ex/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions ex/pokemon/dex.ts

This file was deleted.

38 changes: 0 additions & 38 deletions ex/pokemon/mod.fart

This file was deleted.

27 changes: 0 additions & 27 deletions ex/pokemon/pokeball.ts

This file was deleted.

44 changes: 0 additions & 44 deletions ex/pokemon/run.ts

This file was deleted.

1 change: 1 addition & 0 deletions lib/tokenize/t.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// deno-lint-ignore-file camelcase
// This file simply exports an object which contains lightweight
// functions for creating Token instances with fewer keystrokes;
// used primarily for testing-purposes.
Expand Down
29 changes: 24 additions & 5 deletions lib/transpile/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,41 @@ interface TranspilationContext {
tokenizer: FartTokenGenerator | null;
builder: TextBuilder | null;
prevTokens: Token[];
currentToken: Token | null;
nextToken: () => Token | undefined;
nextStruct: () => Promise<void>;
nextTuple: () => Promise<void>;
}

const INITIAL_TRANSPILATION_CONTEXT: TranspilationContext = Object.freeze({
const INITIAL_TRANSPILATION_CONTEXT: TranspilationContext = {
tokenizer: null,
builder: null,
prevTokens: [],
});
currentToken: null,
nextToken() {
if (this.tokenizer !== null) {
if (this.currentToken !== null) {
this.prevTokens.push(this.currentToken);
}
return this.tokenizer.next().value;
}
},
async nextStruct() {
// TODO: handle struct
},
async nextTuple() {
// TODO: handle tuple
},
};

const initializeTranspilationContext = () => ({
...INITIAL_TRANSPILATION_CONTEXT,
});

export const transpile = async (
export const transpile = (
code: string,
options: FartOptions,
): Promise<string> => {
// options: FartOptions,
): string => {
const ctx = initializeTranspilationContext();
ctx.tokenizer = tokenize(code);

Expand Down

1 comment on commit f8be624

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on f8be624 Dec 8, 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/f8be62409930507aebfd24546c3e668f876b2265/std/server/worker.ts': HTTP status client error (404 Not Found) for url (https://raw.githubusercontent.com/EthanThatOneKid/fart/f8be62409930507aebfd24546c3e668f876b2265/std/server/worker.ts)

Please sign in to comment.