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
7 changes: 7 additions & 0 deletions tests/analysis_tests/perf_test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SHELL = /bin/bash

build:
yarn build

clean:
yarn clean
11 changes: 11 additions & 0 deletions tests/analysis_tests/perf_test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "perf_test",
"private": true,
"scripts": {
"build": "rescript-legacy build",
"clean": "rescript-legacy clean"
},
"dependencies": {
"rescript": "workspace:^"
}
}
10 changes: 10 additions & 0 deletions tests/analysis_tests/perf_test/rescript.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "test",
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"suffix": ".res.js"
}
18 changes: 18 additions & 0 deletions tests/analysis_tests/perf_test/src/Player.js

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

58 changes: 58 additions & 0 deletions tests/analysis_tests/perf_test/src/Player.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@unboxed
type key =
// | @as("f2") F2
// | @as("f3") F3
// | @as("f4") F4
// | @as("f5") F5
// | @as("f6") F6
// | @as("f7") F7
// | @as("f8") F8
// | @as("f9") F9
| @as("f10") F10
| @as("l") L
| @as("m") M
| @as("n") N
| @as("o") O
| @as("p") P
| @as("q") Q
| @as("r") R
| @as("s") S
| @as("t") T
| @as("u") U
| @as("v") V
| @as("w") W
| @as("x") X
| @as("space") Space
| @as("left") Left
| @as("right") Right
| @as("up") Up
| @as("down") Down
| @as("escape") Escape
| @as("backspace") Backspace
| @as("enter") Enter
| @as("tab") Tab
| @as("control") Control
| @as("alt") Alt
| @as("meta") Meta
| @as("shift") Shift
| @as("string") String(string)

@send
external onKeyRelease: (key => unit) => unit = "onKeyRelease"

let make = () => {
let gameObj: Thundershock.t = Obj.magic(3)

onKeyRelease(key => {
let isYAxis = !(gameObj.direction.y == 0.)
switch key {
| Space =>
if isYAxis {
Thundershock.cast(gameObj)->ignore
}
| _ => ()
}
})

gameObj
}
10 changes: 10 additions & 0 deletions tests/analysis_tests/perf_test/src/Thundershock.js

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

15 changes: 15 additions & 0 deletions tests/analysis_tests/perf_test/src/Thundershock.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type team = Player | Opponent

type vec2 = {
mutable x: float,
mutable y: float,
}


type t = {mutable direction: vec2}


let cast = (_: t) => {
()
}

8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2415,6 +2415,14 @@ __metadata:
languageName: node
linkType: hard

"perf_test@workspace:tests/analysis_tests/perf_test":
version: 0.0.0-use.local
resolution: "perf_test@workspace:tests/analysis_tests/perf_test"
dependencies:
rescript: "workspace:^"
languageName: unknown
linkType: soft

"picocolors@npm:^1.0.0, picocolors@npm:^1.1.1":
version: 1.1.1
resolution: "picocolors@npm:1.1.1"
Expand Down
Loading