Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
caijw committed Aug 18, 2019
1 parent e56f48e commit 3c59de0
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 95 deletions.
21 changes: 21 additions & 0 deletions src/index.ts
@@ -0,0 +1,21 @@
import { Tokenizer, IToken } from "./tokenizer";
import * as NodeUtil from "util";

const tokenizer = new Tokenizer();

const codes: string[] = [
`int age = 45;`,
`;;;`,
// "inta age = 45;",
// "in age = 45;",
// "age >= 45;",
// "age > 45;",
];

codes.forEach((code) => {
tokenizer.tokenize(code);
const tokens = tokenizer.getTokens();
console.log("code:");
console.log(code);
console.log(NodeUtil.inspect(tokens, { depth: 10, colors: true, maxArrayLength: 1000 }));
});

0 comments on commit 3c59de0

Please sign in to comment.