Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

514 builtins support #240

Merged
merged 17 commits into from
Feb 3, 2021
Merged

514 builtins support #240

merged 17 commits into from
Feb 3, 2021

Conversation

ZeWaka
Copy link
Contributor

@ZeWaka ZeWaka commented Feb 1, 2021

Don't know if you want to put this based on a 514 branch or something, for full support. Here's the bulk of the work done for the builtins though.

  • gradient()
  • animate(space) // weird form
  • rgb(space) // weird form
  • rgb2num()
  • filter(type="bloom")
  • load_resource()
  • splicetext()
  • list.Splice()
  • time2text()
  • world.timezone
  • client.timezone
  • ||=
  • &&=
  • world.movement_mode + enums
  • := walrus/assign-into/expression assign
  • ?[] // byond my abilities
  • world.map_cpu
  • particles/
  • generator/
  • embedded winget syntax // don't think we need to add anything
  • mouse actions // don't think we need to add anything

note: uncovered http://www.byond.com/forum/post/2652280

notes:

  • didn't know for sure the right order for the PUNCT_TABLE, it says shorter entries be first, but it is unclear what it means by shorter - might mean sub-string length (if that's even the right word)?

Tested the produced executable:
image

@ZeWaka ZeWaka marked this pull request as ready for review February 2, 2021 00:24
src/dreammaker/lexer.rs Outdated Show resolved Hide resolved
@SpaceManiac
Copy link
Owner

?[] // beyond my abilities

will think on this one but I suspect it will end up being a new ?[ punctuation named SafeLBracket or something like that

src/dreammaker/lexer.rs Outdated Show resolved Hide resolved
also clean up of speedy table
src/dreammaker/lexer.rs Outdated Show resolved Hide resolved
src/dreammaker/lexer.rs Outdated Show resolved Hide resolved
@SpaceManiac
Copy link
Owner

Thanks for the PR. Can punt on ?[ until later if you like

@@ -434,6 +453,7 @@ pub fn register_builtins(tree: &mut ObjectTree) {
proc/get_step_rand(Ref);
proc/get_step_to(Ref,Trg,Min=0);
proc/get_step_towards(Ref,Trg);
proc/gradient(Gradient, index); // unsure how to handle (Item1, Item2, ..., index) form
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious on if there's a proper way to address the two forms at once

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, but it really only affects the popup parameter list completion, so it hasn't been a priority

@@ -376,7 +394,7 @@ pub fn register_builtins(tree: &mut ObjectTree) {
alpha, color, infra_luminosity, layer, maptext_width, maptext_height,
maptext_x, maptext_y, luminosity, pixel_x, pixel_y, pixel_w, pixel_z,
transform, dir, icon, icon_state, invisibility, maptext, suffix, appearance,
dir, radius,
dir, radius, space,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: if space is specified, color must be as well - potential linting/testing in the future?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible feature for the in-depth filter() verifier

src/dreammaker/builtins.rs Outdated Show resolved Hide resolved
src/dreammaker/builtins.rs Show resolved Hide resolved

// 514 stuff

generator;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be nice to have an enum for the various types, and the applicable defines for rand being an enum as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how to handle the operator overloads for this either

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the existence of operator overloads for builtins isn't currently described by SpacemanDMM


generator;
generator/proc/Rand();
generator/proc/Turn(a);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's also a weird operator_turn in relation to this

@ZeWaka
Copy link
Contributor Author

ZeWaka commented Feb 2, 2021

no idea how we're going to support matrix/proc/operator:=(m), sound/proc/operator:=(sound/sound), and icon/proc/operator:=(icon)

@SpaceManiac SpaceManiac merged commit 244509c into SpaceManiac:master Feb 3, 2021
@ZeWaka ZeWaka deleted the 514-builtins branch February 3, 2021 01:12
j-awn pushed a commit to j-awn/SpacemanDMM that referenced this pull request Apr 1, 2021
Don't know if you want to put this based on a 514 branch or something, 
for full support. Here's the bulk of the work done for the builtins 
though.

- gradient()
- animate(space) // weird form
- rgb(space) // weird form
- rgb2num()
- filter(type="bloom")
- load_resource()
- splicetext()
- list.Splice()
- time2text()
- world.timezone
- client.timezone
- ||=
- &&=
- world.movement_mode + enums
- := walrus/assign-into/expression assign
- world.map_cpu
- particles/
- generator/
- embedded winget syntax // don't think we need to add anything
- mouse actions // don't think we need to add anything

note: uncovered http://www.byond.com/forum/post/2652280

Tested the produced executable:
![image](https://user-images.githubusercontent.com/4741640/106538107-8d2
58480-64b0-11eb-9d65-0020229647d7.png)
@SpaceManiac SpaceManiac added this to the suite v1.7 milestone May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants