fix lsp build

This commit is contained in:
Rachel
2024-03-29 19:06:16 -07:00
parent 5706c82553
commit 78463e6701
5 changed files with 1905 additions and 2 deletions

9
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,9 @@
{
"rust-analyzer.linkedProjects": [
".\\ic10emu_wasm\\Cargo.toml",
".\\ic10emu\\Cargo.toml",
".\\ic10lsp_wasm\\Cargo.toml"
],
"rust-analyzer.check.allTargets": false,
"rust-analyzer.cargo.target": "wasm32-unknown-unknown"
}

27
ic10emu/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'ic10emu'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=ic10emu"
],
"filter": {
"name": "ic10emu",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

View File

@@ -0,0 +1,136 @@
abs Register = the absolute value of a
acos Returns the angle (radians) whos cosine is the specified value
add Register = a + b.
alias Labels register or device reference with name, device references also affect what shows on the screws on the IC base.
and Performs a bitwise logical AND operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If both bits are 1, the resulting bit is set to 1. Otherwise the resulting bit is set to 0.
asin Returns the angle (radians) whos sine is the specified value
atan Returns the angle (radians) whos tan is the specified value
atan2 Returns the angle (radians) whose tangent is the quotient of two specified values: a (y) and b (x)
bap Branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8)
bapal Branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8) and store next line number in ra
bapz Branch to line c if abs(a) <= float.epsilon * 8
bapzal Branch to line c if abs(a) <= float.epsilon * 8
bdns Branch to line a if device d isn't set
bdnsal Jump execution to line a and store next line number if device is not set
bdse Branch to line a if device d is set
bdseal Jump execution to line a and store next line number if device is set
beq Branch to line c if a == b
beqal Branch to line c if a == b and store next line number in ra
beqz Branch to line b if a == 0
beqzal Branch to line b if a == 0 and store next line number in ra
bge Branch to line c if a >= b
bgeal Branch to line c if a >= b and store next line number in ra
bgez Branch to line b if a >= 0
bgezal Branch to line b if a >= 0 and store next line number in ra
bgt Branch to line c if a > b
bgtal Branch to line c if a > b and store next line number in ra
bgtz Branch to line b if a > 0
bgtzal Branch to line b if a > 0 and store next line number in ra
ble Branch to line c if a <= b
bleal Branch to line c if a <= b and store next line number in ra
blez Branch to line b if a <= 0
blezal Branch to line b if a <= 0 and store next line number in ra
blt Branch to line c if a < b
bltal Branch to line c if a < b and store next line number in ra
bltz Branch to line b if a < 0
bltzal Branch to line b if a < 0 and store next line number in ra
bna Branch to line d if abs(a - b) > max(c * max(abs(a), abs(b)), float.epsilon * 8)
bnaal Branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8) and store next line number in ra
bnan Branch to line b if a is not a number (NaN)
bnaz Branch to line c if abs(a) > float.epsilon * 8
bnazal Branch to line c if abs(a) > float.epsilon * 8
bne Branch to line c if a != b
bneal Branch to line c if a != b and store next line number in ra
bnez branch to line b if a != 0
bnezal Branch to line b if a != 0 and store next line number in ra
brap Relative branch to line d if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8)
brapz Relative branch to line c if abs(a) <= float.epsilon * 8
brdns Relative jump to line a if device is not set
brdse Relative jump to line a if device is set
breq Relative branch to line c if a == b
breqz Relative branch to line b if a == 0
brge Relative jump to line c if a >= b
brgez Relative branch to line b if a >= 0
brgt relative jump to line c if a > b
brgtz Relative branch to line b if a > 0
brle Relative jump to line c if a <= b
brlez Relative branch to line b if a <= 0
brlt Relative jump to line c if a < b
brltz Relative branch to line b if a < 0
brna Relative branch to line d if abs(a - b) > max(c * max(abs(a), abs(b)), float.epsilon * 8)
brnan Relative branch to line b if a is not a number (NaN)
brnaz Relative branch to line c if abs(a) > float.epsilon * 8
brne Relative branch to line c if a != b
brnez Relative branch to line b if a != 0
ceil Register = smallest integer greater than a
cos Returns the cosine of the specified angle (radians)
define Creates a label that will be replaced throughout the program with the provided value.
div Register = a / b
exp Register = exp(a)
floor Register = largest integer less than a
hcf Halt and catch fire
j Jump execution to line a
jal Jump execution to line a and store next line number in ra
jr Relative jump to line a
l Loads device LogicType to register by housing index value.
label DEPRECATED
lb Loads LogicType from all output network devices with provided type hash using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
lbn Loads LogicType from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
lbns Loads LogicSlotType from slotIndex from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
lbs Loads LogicSlotType from slotIndex from all output network devices with provided type hash using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.
ld Loads device LogicType to register by direct ID reference.
log Register = log(a)
lr Loads reagent of device's ReagentMode where a hash of the reagent type to check for. ReagentMode can be either Contents (0), Required (1), Recipe (2). Can use either the word, or the number.
ls Loads slot LogicSlotType on device to register.
max Register = max of a or b
min Register = min of a or b
mod Register = a mod b (note: NOT a % b)
move Register = provided num or register value.
mul Register = a * b
nor Performs a bitwise logical NOR (NOT OR) operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If both bits are 0, the resulting bit is set to 1. Otherwise, if at least one bit is 1, the resulting bit is set to 0.
not Performs a bitwise logical NOT operation flipping each bit of the input value, resulting in a binary complement. If a bit is 1, it becomes 0, and if a bit is 0, it becomes 1.
or Performs a bitwise logical OR operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If either bit is 1, the resulting bit is set to 1. If both bits are 0, the resulting bit is set to 0.
peek Register = the value at the top of the stack
pop Register = the value at the top of the stack and decrements sp
push Pushes the value of a to the stack at sp and increments sp
rand Register = a random value x with 0 <= x < 1
round Register = a rounded to nearest integer
s Stores register value to LogicType on device by housing index value.
sap Register = 1 if abs(a - b) <= max(c * max(abs(a), abs(b)), float.epsilon * 8), otherwise 0
sapz Register = 1 if |a| <= float.epsilon * 8, otherwise 0
sb Stores register value to LogicType on all output network devices with provided type hash.
sbn Stores register value to LogicType on all output network devices with provided type hash and name.
sbs Stores register value to LogicSlotType on all output network devices with provided type hash in the provided slot.
sd Stores register value to LogicType on device by direct ID reference.
sdns Register = 1 if device is not set, otherwise 0
sdse Register = 1 if device is set, otherwise 0.
select Register = b if a is non-zero, otherwise c
seq Register = 1 if a == b, otherwise 0
seqz Register = 1 if a == 0, otherwise 0
sge Register = 1 if a >= b, otherwise 0
sgez Register = 1 if a >= 0, otherwise 0
sgt Register = 1 if a > b, otherwise 0
sgtz Register = 1 if a > 0, otherwise 0
sin Returns the sine of the specified angle (radians)
sla Performs a bitwise arithmetic left shift operation on the binary representation of a value. It shifts the bits to the left and fills the vacated rightmost bits with a copy of the sign bit (the most significant bit).
sle Register = 1 if a <= b, otherwise 0
sleep Pauses execution on the IC for a seconds
slez Register = 1 if a <= 0, otherwise 0
sll Performs a bitwise logical left shift operation on the binary representation of a value. It shifts the bits to the left and fills the vacated rightmost bits with zeros.
slt Register = 1 if a < b, otherwise 0
sltz Register = 1 if a < 0, otherwise 0
sna Register = 1 if abs(a - b) > max(c * max(abs(a), abs(b)), float.epsilon * 8), otherwise 0
snan Register = 1 if a is NaN, otherwise 0
snanz Register = 0 if a is NaN, otherwise 1
snaz Register = 1 if |a| > float.epsilon, otherwise 0
sne Register = 1 if a != b, otherwise 0
snez Register = 1 if a != 0, otherwise 0
sqrt Register = square root of a
sra Performs a bitwise arithmetic right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with a copy of the sign bit (the most significant bit).
srl Performs a bitwise logical right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with zeros
ss Stores register value to device stored in a slot LogicSlotType on device.
sub Register = a - b.
tan Returns the tan of the specified angle (radians)
trunc Register = a with fractional part removed
xor Performs a bitwise logical XOR (exclusive OR) operation on the binary representation of two values. Each bit of the result is determined by evaluating the corresponding bits of the input values. If the bits are different (one bit is 0 and the other is 1), the resulting bit is set to 1. If the bits are the same (both 0 or both 1), the resulting bit is set to 0.
yield Pauses execution for 1 tick

File diff suppressed because it is too large Load Diff

View File

@@ -395,7 +395,7 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "ic10lsp"
version = "0.7.4"
source = "git+https://github.com/Ryex/ic10lsp.git?branch=wasm#657c59db0c33a4ab071188a6ecfaf1f7144b02d9"
source = "git+https://github.com/Ryex/ic10lsp.git?branch=wasm#425541dea0423778b1bdd0785d81b85ac26ba383"
dependencies = [
"clap",
"const-crc32",
@@ -1043,7 +1043,7 @@ dependencies = [
[[package]]
name = "tree-sitter-ic10"
version = "0.5.2"
source = "git+https://github.com/Ryex/tree-sitter-ic10.git?branch=wasm#5648a5babc6390c67ca30301551f25190f7ef968"
source = "git+https://github.com/Ryex/tree-sitter-ic10.git?branch=wasm#bc0a4398725e68ec8258b70ee929aaa17e032be2"
dependencies = [
"cc",
"tree-sitter",