No more Refs, no more store, every top level def goes in the store, to update store values use :=
This commit is contained in:
parent
31ef279f16
commit
70569dfe48
9 changed files with 58 additions and 74 deletions
11
src/lexer.ts
11
src/lexer.ts
|
|
@ -25,6 +25,7 @@ export type Token = (
|
|||
|
||||
// Symbols
|
||||
| { kind: 'colon' }
|
||||
| { kind: 'colon-equals' }
|
||||
| { kind: 'semicolon' }
|
||||
| { kind: 'backslash' }
|
||||
| { kind: 'pipe' }
|
||||
|
|
@ -214,7 +215,15 @@ export function tokenize(source: string): Token[] {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case ':': tokens.push({ kind: 'colon', line: startLine, column: startColumn, start }); break;
|
||||
case ':': {
|
||||
if (source[i + 1] === '=') {
|
||||
tokens.push({ kind: 'colon-equals', line: startLine, column: startColumn, start });
|
||||
advance();
|
||||
} else {
|
||||
tokens.push({ kind: 'colon', line: startLine, column: startColumn, start });
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ';': tokens.push({ kind: 'semicolon', line: startLine, column: startColumn, start }); break;
|
||||
case '\\': tokens.push({ kind: 'backslash', line: startLine, column: startColumn, start }); break;
|
||||
case '~': tokens.push({ kind: 'tilde', line: startLine, column: startColumn, start }); break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue