Skip to content

Commit

Permalink
civet update (again) and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrk24 committed Oct 22, 2024
1 parent 502760f commit e404ae5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions wasm/in.civet
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ colors := new Colors

// This is a clever little hack: elements.fooBar is the element with id="foo-bar". It uses document.getElementById on
// first access, but then saves it for fast access later.
elements := new Proxy<Record<string, HTMLElement & Record<string, ???>>> {}, get: (target, p) =>
elements := new Proxy<Record string, HTMLElement & Record string, ???> {}, get: (target, p) =>
if p <? 'string' and p !in target
// @ts-expect-error Yes I know there's a type mismatch. It's the best I can come up with.
target[p] = document.getElementById p.replace /[A-Z]/g, '-' + &.toLowerCase()
Expand Down Expand Up @@ -87,7 +87,7 @@ wasmCancel := :void =>
worker = undefined
resolve()

isBufferFull: (buf: ArrayLike<number>) => boolean :=
isBufferFull: (buf: ArrayLike number) => boolean :=
(or)
&# is 4
((&.0 + 256) & 0xf0) is 0xe0 and &# is 3
Expand Down Expand Up @@ -121,7 +121,7 @@ stderr := (char: number | null): void =>
else
char |> String.fromCharCode |> appendText

createWorker := (name: string) => :Promise<void> =>
createWorker := (name: string) => :Promise void =>
threadCount .= -1

clearOutput()
Expand Down Expand Up @@ -150,7 +150,7 @@ createWorker := (name: string) => :Promise<void> =>
elements.runStop.textContent = 'Run!'
elements.runStop.onclick = interpretProgram

worker.onmessage = (event: MessageEvent<MessageType>): void ->
worker.onmessage = (event: MessageEvent MessageType): void ->
switch event.data
[0, null]
resolve()
Expand Down Expand Up @@ -189,7 +189,7 @@ disassembleProgram := createWorker 'disassembleProgram'
expandBase := createWorker 'expandInput'
debugBase := createWorker 'debugProgram'

expandInput := :Promise<void> =>
expandInput := :Promise void =>
await expandBase()
elements.program.value = elements.stdout.innerText
elements.stdout.innerText = ''
Expand Down
8 changes: 4 additions & 4 deletions wasm/package-lock.json

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

2 changes: 1 addition & 1 deletion wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@danielx/civet": "~0.8.6",
"@danielx/civet": "~0.8.7",
"sass": "^1.79.0",
"terser": "^5.27.2"
},
Expand Down
6 changes: 3 additions & 3 deletions wasm/worker.civet
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare var Module:
argTypes: TArgTypes,
args: { [K in keyof TArgTypes]: { string: string; number: number }[TArgTypes[K]] },
options?: { readonly async?: TAsync }
): TReturn | (if true < TAsync then Promise<TReturn>)
): TReturn | (if true < TAsync then Promise TReturn)
declare var FS:
init(
stdin: => (number | null),
Expand Down Expand Up @@ -63,9 +63,9 @@ callInterpreter := (warnings: 0 | 1, disassemble: 0 | 1, expand: 0 | 1) => =>
['string', 'number', 'number', 'number']
[programText, warnings, disassemble, expand]
async: true
catch <? ExitStatus, null, undefined
catch e
postMessage [2, e.toString()]
if e? !<? ExitStatus
postMessage [2, e.toString()]
postMessage [0, null]

signals.set 'interpretProgram', callInterpreter 0, 0, 0
Expand Down

0 comments on commit e404ae5

Please sign in to comment.