Skip to content

Commit

Permalink
0.8 😳
Browse files Browse the repository at this point in the history
  • Loading branch information
Spu7Nix committed Jan 25, 2022
1 parent 12e69eb commit b2dc755
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 73 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

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

15 changes: 9 additions & 6 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@

- Return types for macros with `(arguments) -> return_type { ... }` syntax
- You can spread an array in another array with `..` syntax:
- `spwn eval` subcommand for running code in the console

```rs
b = [3, 4]
$.assert([1, 2, ..b, 5] == [1, 2, 3, 4, 5])
```

- Zip arrays together with `*[...]` syntax:
- Unzip arrays with `*[...]` syntax:

```rs
a = [1, "a"]
b = [2, "b"]
c = [3, "c"]
$.assert([*[a, b, c]] == [[1, 2, 3], ["a", "b", "c"]])
$.assert([\*[a, b, c]] == [[1, 2, 3], ["a", "b", "c"]])
```

- Destructuring additions, including dictionary destruction, and destruction of the syntax mentioned above (`..` and `*[...]`)
Expand All @@ -40,14 +41,16 @@ $.assert([*[a, b, c]] == [[1, 2, 3], ["a", "b", "c"]])
- `&` operator for combining two patterns, so that the resulting pattern requires the value to match both patterns
- `_` pattern, which matches any value (wildcard)
- pattern ternary operator, which returns a value if it matches a pattern, and otherwise returns the default value:
```rs
10 if is >5 else 0 // 10
4 if is >5 else 0 // 0
```
```rs
10 if is >5 else 0 // 10
4 if is >5 else 0 // 0
```
- You can now remove stuff from dictionaries with `dict.delete(key)`

## STD Library Features

- `@chroma` type for color values, this type is now used in for example color triggers instead of RGB arguments
- `level` global variable for reading the objects in the current level
- `@log` and `@runtime_log` types for debug logging to the console or at runtime
- `@set` type for making groups of objects read from the level that can be rotated, scaled, and pasted in the level
- Changes and improvements to many existing types (see the [docs](https://spu7nix.net/spwn/#/std-docs/std-docs))
2 changes: 1 addition & 1 deletion compiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "compiler"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion docgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "docgen"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion editorlive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "editorlive"
version = "0.0.7"
version = "0.0.8"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion errors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "errors"
version = "0.0.7"
version = "0.0.8"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion levelstring/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "levelstring"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion optimizer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "optimizer"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "parser"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shared"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion spwn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spwn"
version = "0.0.7"
version = "0.0.8"
authors = ["Spu7Nix <[email protected]>"]
edition = "2021"
description = "A language for Geometry Dash triggers"
Expand Down
2 changes: 1 addition & 1 deletion spwn/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let end_command = ":build";
println!(
"{}{}{}",
"Type in your code, and type \"".fg(Blue),
"Write your code, and then type \"".fg(Blue),
end_command.fg(Red),
"\" to build it".fg(Blue)
);
Expand Down
4 changes: 2 additions & 2 deletions spwn/wix/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ rustup override unset

rustup default nightly-i686-pc-windows-msvc
cargo install cargo-wix
cargo wix spwn/Cargo.toml --nocapture
cargo wix spwn/Cargo.toml --nocapture --package spwn

rustup default nightly-x86_64-pc-windows-msvc
cargo install cargo-wix
cargo wix spwn/Cargo.toml --nocapture
cargo wix spwn/Cargo.toml --nocapture --package spwn

rustup override set nightly-x86_64-pc-windows-msvc
92 changes: 46 additions & 46 deletions spwn/wix/libraries.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -21,108 +21,108 @@
<Fragment>
<ComponentGroup Id="libraries">

<Component Id="C0" Directory="gamescene" Win64='$(var.Win64)' Guid="{247fd795-7ef0-4cbe-aa27-72fe7a7ae8e3}">
<Component Id="C0" Directory="gamescene" Win64='$(var.Win64)' Guid="{6beab3dc-9b9d-4001-b0df-b24e4a4abef4}">
<File Id="F0" KeyPath="yes" Source="libraries\gamescene\lib.spwn" />
</Component>

<Component Id="C1" Directory="std" Win64='$(var.Win64)' Guid="{630b0f6f-9ad8-4a33-8484-f9a4e2b45bd4}">
<Component Id="C1" Directory="std" Win64='$(var.Win64)' Guid="{0958956e-6bb0-4ba0-867f-b0eeea9639a8}">
<File Id="F1" KeyPath="yes" Source="libraries\std\array.spwn" />
</Component>

<Component Id="C2" Directory="std" Win64='$(var.Win64)' Guid="{1870f288-1fad-408c-842d-91cebadf3f3f}">
<File Id="F2" KeyPath="yes" Source="libraries\std\binary_counter.spwn" />
<Component Id="C2" Directory="std" Win64='$(var.Win64)' Guid="{20d4f69a-ce67-43ea-abd7-ab94852cfb4d}">
<File Id="F2" KeyPath="yes" Source="libraries\std\block.spwn" />
</Component>

<Component Id="C3" Directory="std" Win64='$(var.Win64)' Guid="{6e67c1ce-3d4f-477e-a560-c87b410dfda8}">
<File Id="F3" KeyPath="yes" Source="libraries\std\block.spwn" />
<Component Id="C3" Directory="std" Win64='$(var.Win64)' Guid="{252c7ea4-aec6-4975-b610-69994b0f5dc6}">
<File Id="F3" KeyPath="yes" Source="libraries\std\chroma.spwn" />
</Component>

<Component Id="C4" Directory="std" Win64='$(var.Win64)' Guid="{edc7135c-a69a-4cb4-b2c0-51505c06b35d}">
<Component Id="C4" Directory="std" Win64='$(var.Win64)' Guid="{afbad6a9-0464-45b1-8b06-06cfc2a91715}">
<File Id="F4" KeyPath="yes" Source="libraries\std\color.spwn" />
</Component>

<Component Id="C5" Directory="std" Win64='$(var.Win64)' Guid="{8d6e98de-68cc-4563-8fff-02c8c47caeee}">
<File Id="F5" KeyPath="yes" Source="libraries\std\complex.spwn" />
<Component Id="C5" Directory="std" Win64='$(var.Win64)' Guid="{e8d6dd2e-b6f7-45e2-bf29-4aa8ced08bb4}">
<File Id="F5" KeyPath="yes" Source="libraries\std\constants.spwn" />
</Component>

<Component Id="C6" Directory="std" Win64='$(var.Win64)' Guid="{968724c0-17a5-4008-96fe-d0219e485bba}">
<File Id="F6" KeyPath="yes" Source="libraries\std\constants.spwn" />
<Component Id="C6" Directory="std" Win64='$(var.Win64)' Guid="{d40f6325-0534-4122-8397-7a61679261b0}">
<File Id="F6" KeyPath="yes" Source="libraries\std\control_flow.spwn" />
</Component>

<Component Id="C7" Directory="std" Win64='$(var.Win64)' Guid="{e5cffe75-4a90-435e-94fd-435f9e6f443d}">
<File Id="F7" KeyPath="yes" Source="libraries\std\control_flow.spwn" />
<Component Id="C7" Directory="std" Win64='$(var.Win64)' Guid="{4e1c613b-f283-430b-b629-e1dcde2ee534}">
<File Id="F7" KeyPath="yes" Source="libraries\std\counter.spwn" />
</Component>

<Component Id="C8" Directory="std" Win64='$(var.Win64)' Guid="{01a0788b-cfd8-45e2-bb68-764b6c186146}">
<File Id="F8" KeyPath="yes" Source="libraries\std\counter.spwn" />
<Component Id="C8" Directory="std" Win64='$(var.Win64)' Guid="{b95952d6-41fe-4e13-a9cd-569d8f95f84d}">
<File Id="F8" KeyPath="yes" Source="libraries\std\dictionary.spwn" />
</Component>

<Component Id="C9" Directory="std" Win64='$(var.Win64)' Guid="{8dab303f-fd45-4dd8-af3a-15d37db24129}">
<File Id="F9" KeyPath="yes" Source="libraries\std\dictionary.spwn" />
<Component Id="C9" Directory="std" Win64='$(var.Win64)' Guid="{2c8f9841-7fd9-4a5f-bfa2-58beee417550}">
<File Id="F9" KeyPath="yes" Source="libraries\std\events.spwn" />
</Component>

<Component Id="C10" Directory="std" Win64='$(var.Win64)' Guid="{6b155403-42ae-4f06-b1bb-85740137ce51}">
<File Id="F10" KeyPath="yes" Source="libraries\std\events.spwn" />
<Component Id="C10" Directory="std" Win64='$(var.Win64)' Guid="{fba2815d-02a4-47df-992c-595cb8de9bf5}">
<File Id="F10" KeyPath="yes" Source="libraries\std\fileio.spwn" />
</Component>

<Component Id="C11" Directory="std" Win64='$(var.Win64)' Guid="{8be2cbd2-43f2-4024-9a99-9e409ee8ab0f}">
<File Id="F11" KeyPath="yes" Source="libraries\std\fileio.spwn" />
<Component Id="C11" Directory="std" Win64='$(var.Win64)' Guid="{10935958-6701-4b24-ace3-7b1ef5c2613d}">
<File Id="F11" KeyPath="yes" Source="libraries\std\general_triggers.spwn" />
</Component>

<Component Id="C12" Directory="std" Win64='$(var.Win64)' Guid="{886b6b90-e265-49c2-a180-19e4ee666d3c}">
<File Id="F12" KeyPath="yes" Source="libraries\std\general_triggers.spwn" />
<Component Id="C12" Directory="std" Win64='$(var.Win64)' Guid="{8674de14-9916-4d12-bc23-0478f1f570cd}">
<File Id="F12" KeyPath="yes" Source="libraries\std\group.spwn" />
</Component>

<Component Id="C13" Directory="std" Win64='$(var.Win64)' Guid="{2e242f72-ed03-41b9-b4ef-8756c33346f2}">
<File Id="F13" KeyPath="yes" Source="libraries\std\group.spwn" />
<Component Id="C13" Directory="std" Win64='$(var.Win64)' Guid="{cc9e9fbd-34e4-4780-8364-808fbd693e26}">
<File Id="F13" KeyPath="yes" Source="libraries\std\http.spwn" />
</Component>

<Component Id="C14" Directory="std" Win64='$(var.Win64)' Guid="{5055dc24-b34b-45bd-9af6-800e81cc4d80}">
<File Id="F14" KeyPath="yes" Source="libraries\std\heapq.spwn" />
<Component Id="C14" Directory="std" Win64='$(var.Win64)' Guid="{251586eb-84e5-489e-a5ce-8a85919cdb81}">
<File Id="F14" KeyPath="yes" Source="libraries\std\item.spwn" />
</Component>

<Component Id="C15" Directory="std" Win64='$(var.Win64)' Guid="{a39b63ee-d26c-4f9f-895f-c50688ba69c6}">
<File Id="F15" KeyPath="yes" Source="libraries\std\http.spwn" />
<Component Id="C15" Directory="std" Win64='$(var.Win64)' Guid="{3f91b0b8-9259-49c9-b7dd-f7b81dd0b84b}">
<File Id="F15" KeyPath="yes" Source="libraries\std\level_info.spwn" />
</Component>

<Component Id="C16" Directory="std" Win64='$(var.Win64)' Guid="{910e15eb-0c62-4b06-ab29-500240bd4b18}">
<File Id="F16" KeyPath="yes" Source="libraries\std\item.spwn" />
<Component Id="C16" Directory="std" Win64='$(var.Win64)' Guid="{219ec920-63c3-4290-acec-db5e3bf815fd}">
<File Id="F16" KeyPath="yes" Source="libraries\std\lib.spwn" />
</Component>

<Component Id="C17" Directory="std" Win64='$(var.Win64)' Guid="{7170a02a-641c-492b-92da-b61b92610695}">
<File Id="F17" KeyPath="yes" Source="libraries\std\lib.spwn" />
<Component Id="C17" Directory="std" Win64='$(var.Win64)' Guid="{457eb397-6651-4e2f-9bbd-5b849d4d683a}">
<File Id="F17" KeyPath="yes" Source="libraries\std\log.spwn" />
</Component>

<Component Id="C18" Directory="std" Win64='$(var.Win64)' Guid="{4ad9cb2f-cb89-4e80-bb40-23cae42c1019}">
<Component Id="C18" Directory="std" Win64='$(var.Win64)' Guid="{7cd1045a-935b-476c-bc64-de6cc86b650f}">
<File Id="F18" KeyPath="yes" Source="libraries\std\number.spwn" />
</Component>

<Component Id="C19" Directory="std" Win64='$(var.Win64)' Guid="{8977cbfa-8691-48c4-830e-578ae29e2642}">
<Component Id="C19" Directory="std" Win64='$(var.Win64)' Guid="{a8a2efcd-416e-4599-a060-0be8fb59c9e2}">
<File Id="F19" KeyPath="yes" Source="libraries\std\object.spwn" />
</Component>

<Component Id="C20" Directory="std" Win64='$(var.Win64)' Guid="{8ad46d1c-ac66-4358-962b-decf0138536d}">
<File Id="F20" KeyPath="yes" Source="libraries\std\obj_set.spwn" />
<Component Id="C20" Directory="std" Win64='$(var.Win64)' Guid="{ba42da4a-40ea-495f-9cf1-ab94b264ddb7}">
<File Id="F20" KeyPath="yes" Source="libraries\std\range.spwn" />
</Component>

<Component Id="C21" Directory="std" Win64='$(var.Win64)' Guid="{f905f19d-266a-4b17-9864-396c2be00fb2}">
<Component Id="C21" Directory="std" Win64='$(var.Win64)' Guid="{d541138c-a0f1-410f-a208-b7f2c883b009}">
<File Id="F21" KeyPath="yes" Source="libraries\std\regex.spwn" />
</Component>

<Component Id="C22" Directory="std" Win64='$(var.Win64)' Guid="{d284af94-2e9d-48fe-8937-e4e2072444b0}">
<File Id="F22" KeyPath="yes" Source="libraries\std\string.spwn" />
<Component Id="C22" Directory="std" Win64='$(var.Win64)' Guid="{132c1b23-2a6c-4351-b159-83db30c39a96}">
<File Id="F22" KeyPath="yes" Source="libraries\std\set.spwn" />
</Component>

<Component Id="C23" Directory="std" Win64='$(var.Win64)' Guid="{528cf0f6-9feb-4e67-b39d-f76ee099b44d}">
<File Id="F23" KeyPath="yes" Source="libraries\std\util.spwn" />
<Component Id="C23" Directory="std" Win64='$(var.Win64)' Guid="{6a1af559-a945-4b6f-afb2-5bafb74e80e2}">
<File Id="F23" KeyPath="yes" Source="libraries\std\string.spwn" />
</Component>

<Component Id="C24" Directory="std" Win64='$(var.Win64)' Guid="{1c6c4cae-76c4-413f-b07a-456edeb51aca}">
<File Id="F24" KeyPath="yes" Source="libraries\std\vector.spwn" />
<Component Id="C24" Directory="std" Win64='$(var.Win64)' Guid="{1d6d488c-b288-4ba2-b757-24a293b356ca}">
<File Id="F24" KeyPath="yes" Source="libraries\std\util.spwn" />
</Component>

<Component Id="C25" Directory="std" Win64='$(var.Win64)' Guid="{e64bfd80-c971-4f59-841f-e496f86b6786}">
<File Id="F25" KeyPath="yes" Source="libraries\std\zip.spwn" />
<Component Id="C25" Directory="std" Win64='$(var.Win64)' Guid="{8044f28e-00ce-4dc9-a866-66501bf37827}">
<File Id="F25" KeyPath="yes" Source="libraries\std\vector.spwn" />
</Component>

</ComponentGroup>
Expand Down

0 comments on commit b2dc755

Please sign in to comment.