Commit graph

1671 commits

Author SHA1 Message Date
Tad Hardesty
4beb1f35af Exclude global procs from parent var/proc linking
Fixes #268.
2021-05-27 18:07:40 -07:00
Tad Hardesty
64e7ffd995 Include commits since tag in langserver version number 2021-05-22 16:40:32 -07:00
Tad Hardesty
838ddf5974 Add script to download extools 2021-05-22 16:07:10 -07:00
Tad Hardesty
3d30bb6f81 Update copyright years to 2021 2021-05-22 16:07:10 -07:00
Tad Hardesty
107c05b92f Add script to build langserver release 2021-05-22 16:07:10 -07:00
Tad Hardesty
5ad8eebb7f Include auxtools with suite releases 2021-05-22 16:07:10 -07:00
Tad Hardesty
087ac47f11 Add script to update auxtools 2021-05-22 16:07:13 -07:00
Tad Hardesty
eb83d179f3 Add script to download auxtools 2021-05-22 16:07:10 -07:00
Tad Hardesty
212ff9aa48 Rename prepare-binaries.sh to build-suite-release 2021-05-22 15:12:27 -07:00
Tad Hardesty
4149da7c13 Bump versions for suite 1.7 2021-05-18 19:27:39 -07:00
Tad Hardesty
4f8e6da845 Run cargo update 2021-05-18 18:17:20 -07:00
Tad Hardesty
3562c659ff Support CRASH() with no arguments
Fixes #245.
2021-05-18 00:00:47 -07:00
Tad Hardesty
74f1cf0ed7 Improve ambiguous_not_bitwise error messages 2021-05-17 23:43:08 -07:00
William Wallace
80f40fe9f7
Fix in & ternary precedence (#260)
Fixes https://github.com/SpaceManiac/SpacemanDMM/issues/122
Fixes `x ?  y : z = 0` being treated as `x ? y : (z = 0)` instead of 
`(x ? y : z) = 0`.

The issue happened with any assignment operator, hopefully this change 
is reasonable.
2021-05-17 23:43:01 -07:00
ZeWaka
f81223ba17
Lints for ambiguous ! on the left hand side of a bitwise operation (#265)
Puts some helpful hints in order of likelihood. Could be intended to 
be: `!(x & y)`

Fulfills
https://github.com/SpaceManiac/SpacemanDMM/projects/1#card-37357276
2021-05-17 23:33:49 -07:00
Tad Hardesty
a47a7d2b02 Add debug-only VSC setting to use a different debug_server.dll 2021-05-17 23:21:43 -07:00
William Wallace
ced2a7f084
auxtools debug server: expression evaluation (#263)
The changes for the language server are minimal. This will require 
shipping version 2.0.0 of the debug server: use 
https://github.com/willox/auxtools/releases/tag/v2.2.0

There are plenty of compiler features missing on the debug server's 
end, but it is definitely more than usable so I want to get it 
published. I plan on going a lot further this all of this, maybe we'll 
even have hot loading one day.

Noticeable differences from actual BYOND are:
1. It only compiles expressions! This means no for loops, no if 
   statements, etc.
2. It lacks all static typing - the compiler has no access to type 
   definitions and will treat all `.` accesses as `:` accesses and 
   ignore the rules of const.
3. There are no implicit uses of `src`. This comes from the fact that 
   there is no static typing, so to access a field on `src` you have to 
   explicitly use `src.xyz` syntax.
4. Strings are lame. There is no interpolation support and the escape 
   sequences are super limited too.
5. Some built-in procs aren't supported, but most are. They'll 
   gracefully error if you try to use them.
6. No pre-processor.

For other limitations, just view the error list: 
9ba328ef8c/src/compiler.rs (L45-L76)

tl;dr: relatively well-working debug console eval, watch eval, and 
conditional breakpoints
2021-05-17 23:14:34 -07:00
AnturK
f2cdca6fb1
Bump minor BYOND version to 1554 (#264) 2021-05-10 18:15:49 -07:00
William Wallace
9c756347de
Add support for L?[x] list access syntax (#262)
I renamed the current `IndexKind` enum to `PropertyAccessKind` purely 
based off of the fact that somewhere in the byond ref both procs and 
vars are referred to as a datum's "properties" and I had no better name 
ideas.

The checker treats conditional list accesses exactly the same as normal 
ones. I was going to add some linting stuff for them but their expected 
behaviour is completely up in the air at the moment.
2021-04-21 18:43:47 -07:00
William Wallace
ba09a43447
Add support for infinite for() loops (#259) 2021-04-21 17:59:41 -07:00
Tad Hardesty
15291e493e Fix 'panic message is not a string literal' warning 2021-04-02 17:51:15 -07:00
Tad Hardesty
e0095431da Disable editor 2021-03-24 20:34:58 -07:00
William Wallace
8c751bde99
Remove list indexing from MiniExpr (#257)
I noticed that this was different from BYOND's behaviour where
`new x[y]` actually compiles as `(new x)[y]`. The same behaviour
applies for `new x?[y]` so I don't anticipate the code I am removing
being needed for that.

I confirmed that BYOND has been compiling it this way since at least
513.1490, so if it changed it was long ago.

[SpaceManiac] As far as I can tell, there was no BYOND change and this 
code was wrong all along.
2021-03-23 17:50:31 -07:00
William Wallace
7c2b92189c
pipe_output no longer stops piping after encountering invalid utf-8 (#256)
This only becomes a problem when stuff we haven't got control over 
decides to output to stdin or stderr.

vgstation-coders/vgstation13#28789 shows (in the most recent responses) 
that they're using an internet explorer plugin which outputs some debug 
info to stderr and terminates it with some invalid utf-8 or something. 
I don't think the details on that side are too important, we just need 
to fix the next part: This makes the language server's pipe_output 
close the stream which then makes auxtools panic when it tries writing 
to said stream (because eprintln!() will panic in such a case.)

Auxtools could handle this better, but there's no reason for the 
debugger to just stop piping output because it sees some wacky bytes.
2021-03-19 17:14:53 -07:00
Tad Hardesty
2dbdeb855f Improve readability of rgb() tests 2021-03-18 22:07:32 -07:00
ZeWaka
7e3731ea92
Add 514 rgb() support (#254)
Allows for `rgb()` with arguments of form 
`[r,g,b|h,s,[v|l|y]],(a),(space)`

Also allows the full names of the arguments. Technically, BYOND 
supports just the first letter so `halifax` works for `hue` but fuck 
that.

Also now lints to see if the values are in the valid ranges.

Co-authored-by: Tad Hardesty <tad@platymuus.com>
2021-03-18 21:56:05 -07:00
ZeWaka
0a108b69af
panic! supports formatting (#255) 2021-03-16 03:39:03 +08:00
spookydonut
3d798cee8c Remove debugging println macro. 2021-03-12 14:36:05 +08:00
Tad Hardesty
d2b3f61032 Track disk I/O time separately from parse time 2021-03-11 19:24:14 -08:00
spookydonut
f8641c71e8 Remove duplicate particle grow var 2021-03-11 17:05:06 +08:00
spookydonut
42163b5d91
Add detection of sleeping client procs (#252)
* This should work but doesn't.

* bugfix maybe?

* working now
2021-03-11 17:00:18 +08:00
spookydonut
8999f1cc63 Add new 514.1549 features and increment DM version constants to match 2021-03-10 16:01:12 +08:00
Tad Hardesty
635434f8ee Add /world/var/movement_mode to builtins 2021-02-18 17:04:35 -08:00
Pieter-Jan Briers
e07801070e
Optimize map rendering (#242)
It is much faster now, way less terrible blitting code.

---
SpaceManiac's benchmarks indicate about 9% speedup when rendering MetaStation with `--release` on.
2021-02-16 18:00:18 -08:00
Tad Hardesty
0b95746cb8 Add a ConstFn entry for generator()
Fixes #244.
2021-02-16 17:51:30 -08:00
ZeWaka
2826cb3af3
Add new particle variable added by 514.1547 (#246)
Supporting new `particles/var/grow` variable.

http://www.byond.com/forum/?forum=6&command=search&scope=local&text=resolved%3a514.1547
2021-02-16 17:43:22 -08:00
Tad Hardesty
366f14aadd Disable forbidding of unreachable_patterns in editor keychord handler 2021-02-16 17:41:58 -08:00
Tad Hardesty
58e6e7f6fd Fix broken use of syn private re-exports 2021-02-08 12:52:19 -08:00
Tad Hardesty
3e8021087a Run 'cargo update' 2021-02-08 12:50:35 -08:00
ZeWaka
6729f4e9d5
Fix flag names for 'layer' and 'rays' filters (#243) 2021-02-05 18:15:05 -08:00
Tad Hardesty
75eb2df5f9 Order operators properly, add test to enforce this 2021-02-02 17:00:10 -08:00
ZeWaka
244509ce85
Add most 514 builtins support (#240)
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)
2021-02-02 16:59:11 -08:00
Tad Hardesty
591b404075 Show stdout/stderr of launched process in Debug Console 2021-01-21 20:42:36 -08:00
Tad Hardesty
8a07b193ae Set LD_LIBRARY_PATH in case of launching DreamDaemon 2021-01-21 20:09:22 -08:00
William Wallace
4ea806047c
Offload eval (disassemble/help commands) processing to auxtools (#238)
This requires an update to 
https://github.com/willox/auxtools/releases/tag/debug-v1.0.0. 

Basically, this'll let me add new debug console commands without having 
to touch SpacemanDMM. I'm gonna be adding some as I push my way through 
some DM bytecode related stuff so this'll save me a bunch of effort.

There's no new functionality here, it's still only `#help` and `#dis`.

The DLL is starting to get a bit big (it's still much smaller than a 
tiny example implementing maptick which for some reason comes out at 
2.5MB) so I'll try to get them smaller before making any new releases.
2021-01-21 20:09:15 -08:00
Tad Hardesty
809bdceb5f Add FALSE and TRUE as macros
Many other builtin global consts should also double as macros, but
documentation attributes will need to be supported for them.
2021-01-13 20:35:14 -08:00
Tad Hardesty
299f142b05 Add variable name to const-evaluation error 2021-01-13 20:33:36 -08:00
Tad Hardesty
a01f4116d6 Add first version of ref linking to dmdoc 2020-12-14 21:58:07 -08:00
Tad Hardesty
23270e6aeb Use manually specified hash in langserver go-to-def 2020-12-13 16:24:18 -08:00
Tad Hardesty
1dd4c21c4e Add dm_ref attributes to some builtins 2020-12-13 15:47:16 -08:00