Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/assets/index.37f60680.css

This file was deleted.

1 change: 1 addition & 0 deletions docs/assets/index.56e520d8.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8" />
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" >
<script type="module" crossorigin src="https://darkruby.co.uk/simple-parser/assets/index.4a155a8e.js"></script>
<link rel="stylesheet" href="https://darkruby.co.uk/simple-parser/assets/index.37f60680.css">
<script type="module" crossorigin src="/assets/index.4a155a8e.js"></script>
<link rel="stylesheet" href="/assets/index.56e520d8.css">
</head>

<body class="body">
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"scripts": {
"start": "vite",
"check": "tsc --noEmit",
"build": "vite build",
"build-gh": "vite build --base https://darkruby.co.uk/simple-parser/",
"build": "vite build --base https://darkruby.co.uk/simple-parser/",
"test": "vitest --run"
},
"dependencies": {
Expand Down
10 changes: 8 additions & 2 deletions src/parser/tokenStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ const KEYWORDS = ["if", "then", "else", "lambda", "true", "false", "let"];

export type Token = { type: TokenType; value: string | number };

const includes = (...chars: string[]) => (c: string) => chars.indexOf(c) >= 0;
const excludes = (...chars: string[]) => (c: string) => !includes(...chars)(c);
const includes =
(...chars: string[]) =>
(c: string) =>
chars.indexOf(c) >= 0;
const excludes =
(...chars: string[]) =>
(c: string) =>
!includes(...chars)(c);
const isPunctuation = includes(...PUNCT);
const isWhitespace = includes(...WHITESPACE);
const isIdentifier = includes(...IDENTIFIER);
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitReturns": true,
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true,
"typeRoots": [
"./node_modules/@types"
],
Expand Down