Commit Graph

113 Commits

Author SHA1 Message Date
Arseny Kapoulkine
71df988dec Merge branch 'upstream' into merge 2022-09-08 14:45:28 -07:00
Arseny Kapoulkine
dec4b67b5a Sync to upstream/release/544 2022-09-08 14:44:50 -07:00
Arseny Kapoulkine
75b8a2a032 Merge branch 'upstream' into merge 2022-09-01 16:00:56 -07:00
Arseny Kapoulkine
c6ac06e656 Sync to upstream/release/543 2022-09-01 16:00:14 -07:00
JohnnyMorganz
e9e2cba77a
Fix overloaded metamethod in class definitions (#653)
Fixes #652
2022-08-29 08:28:04 -07:00
Arseny Kapoulkine
b2f9f53ae3
Sync to upstream/release/542 (#649)
- Fix DeprecatedGlobal warning text in cases when the global is deprecated without a suggested alternative
- Fix an off-by-one error in type error text for incorrect use of string.format
- Reduce stack consumption further during parsing, hopefully eliminating stack overflows during parsing/compilation for good
- Mark interpolated string support as experimental (requires --fflags=LuauInterpolatedStringBaseSupport to enable)
- Simplify garbage collection treatment of upvalues, reducing cache misses during sweeping stage and reducing the cost of upvalue assignment (SETUPVAL); supersedes #643
- Simplify garbage collection treatment of sleeping threads
- Simplify sweeping of alive threads, reducing cache misses during sweeping stage
- Simplify management of string buffers, removing redundant linked list operations
2022-08-25 14:53:50 -07:00
Arseny Kapoulkine
3008da98df Sync to upstream/release/542 2022-08-25 13:55:08 -07:00
boyned//Kampfkarren
da9d8e8c60
String interpolation (#614)
Implements the string interpolation RFC (#165).

Adds the string interpolation as per the RFC.

```lua
local name = "world"
print(`Hello {name}!`) -- Hello world!
```

Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
2022-08-24 12:01:00 -07:00
JohnnyMorganz
a95dff3223
Pass environment scope to autocomplete typechecker (#610)
Fixes a bug where the environment scope is not passed to the autocomplete typechecker, so environment-related types are not provided.

This caused an issue where `getModuleEnvironment` returns `typeChecker.globalScope` when there is no environment. We pass this through to `typeCheckerForAutocomplete.check()` then environmentscope is no longer nullopt and it will use `typeChecker.globalScope` instead of falling back to `typeCheckerForAutocomplete.globalScope`.

This is solved by passing `forAutocomplete` to `getModuleEnvironment` so it falls back to the autocomplete global scope if none found.
2022-08-23 11:53:02 -07:00
Arseny Kapoulkine
be2769ad14
Sync to upstream/release/541 (#644)
- Fix autocomplete not suggesting globals defined after the cursor (fixes #622)
- Improve type checker stability
- Reduce parser C stack consumption which fixes some stack overflow crashes on deeply nested sources
- Improve performance of bit32.extract/replace when width is implied (~3% faster chess)
- Improve performance of bit32.extract when field/width are constants (~10% faster base64)
- Heap dump now annotates thread stacks with local variable/function names
2022-08-18 14:32:08 -07:00
Arseny Kapoulkine
b3e6dcecfd Sync to upstream/release/541 2022-08-18 14:04:33 -07:00
Arseny Kapoulkine
f7d8ad0774
Sync to upstream/release/540 (#635)
Also adjust benchmark runs to use config=profile and run clang for all benchmarks + gcc for runtime
2022-08-11 14:01:33 -07:00
Arseny Kapoulkine
106b269885 Sync to upstream/release/540 2022-08-11 13:42:54 -07:00
JohnnyMorganz
e15b0728be
Add autocomplete context to result (#611)
Closes #599 

Not sure if these context definitions are distinct enough, but they work for my use cases.

I repurposed (a majority of) the existing unit tests for this, but if it should live in separate test cases let me know

---
* Add autocomplete context to result

* Update tests

* Remove comments

* Fix expression context issues
2022-08-10 13:04:08 -07:00
Arseny Kapoulkine
1b20fcd43c
Sync to upstream/release/539 (#625) 2022-08-04 15:35:33 -07:00
Arseny Kapoulkine
4a9cfd57a6 Sync to upstream/release/539 2022-08-04 14:27:28 -07:00
boyned//Kampfkarren
4658219df2
Add %* format specifier (#619)
RFC: https://github.com/Roblox/luau/pull/165
2022-08-04 07:22:16 -07:00
Arseny Kapoulkine
d3b566c258
Sync to upstream/release/538 (#616) 2022-07-28 21:24:07 -07:00
Arseny Kapoulkine
3202869acc Sync to upstream/release/538 2022-07-28 20:41:13 -07:00
JohnnyMorganz
2a6d1c03ac
Store AstExprFunction in astTypes for stats (#612) 2022-07-25 10:19:21 -07:00
Arseny Kapoulkine
b1cfaf5305
Sync to upstream/release/537 (#607) 2022-07-21 14:16:54 -07:00
Arseny Kapoulkine
8e8ae0a01d Sync to upstream/release/537 2022-07-21 13:36:41 -07:00
Arseny Kapoulkine
5b2e39c922
Sync to upstream/release/536 (#592) 2022-07-14 15:52:26 -07:00
Arseny Kapoulkine
4bd651292d Sync to upstream/release/536 2022-07-14 15:39:35 -07:00
Arseny Kapoulkine
506d971421
Sync to upstream/release/535 (#584) 2022-07-07 18:22:39 -07:00
Arseny Kapoulkine
4a95f2201e Sync to upstream/release/535 2022-07-07 18:05:31 -07:00
JohnnyMorganz
baa35117bd
Use syntheticName for stringified MetatableTypeVar (#563) 2022-07-05 09:19:54 -07:00
JohnnyMorganz
4d98a16ea8
Store resolved types in astResolvedTypes (#574) 2022-07-05 09:08:05 -07:00
JohnnyMorganz
6303ae30c4
Fix op used when stringifying AstExprIndexName (#572)
* Fix op used when stringifying AstExprIndexName

* Remove visualizeWithSelf
2022-07-05 08:59:09 -07:00
Arseny Kapoulkine
2daa6497a1
Sync to upstream/release/534 (#569) 2022-06-30 16:52:43 -07:00
Arseny Kapoulkine
8f040862b1 Sync to upstream/release/534 2022-06-30 16:29:02 -07:00
Arseny Kapoulkine
08ab7da4db
Sync to upstream/release/533 (#560) 2022-06-23 18:56:00 -07:00
Arseny Kapoulkine
6d14bdadf4 Sync to upstream/release/533 2022-06-23 18:44:07 -07:00
Qualadore
e0ac24d1ed
Correct string.find and string.match return types (#554) 2022-06-22 09:01:34 -07:00
Arseny Kapoulkine
f1b46f4b96
Sync to upstream/release/532 (#545) 2022-06-16 18:05:14 -07:00
Arseny Kapoulkine
88b3984711 Sync to upstream/release/532 2022-06-16 17:54:42 -07:00
Arseny Kapoulkine
316838f253 Sync to upstream/release/531 2022-06-16 17:52:23 -07:00
JohnnyMorganz
c30ab0647b
Improve table stringifier when line breaks enabled (#488)
* Improve table stringifier when line breaks enabled

* Add FFlag

* Fix FFlags
2022-06-14 08:39:25 -07:00
rblanckaert
b066e4c8f8
0.531 (#532)
* Fix free Luau type being fully overwritten by 'any' and causing UAF
* Fix lua_clonefunction implementation replacing top instead of pushing
* Falsey values other than false can now narrow refinements
* Fix lua_getmetatable, lua_getfenv not waking thread up
* FIx a case where lua_objlen could push a new string without thread wakeup or GC
* Moved Luau math and bit32 definitions to definition file 
* Improve Luau parse recovery of incorrect return type token
2022-06-10 09:58:21 -07:00
Daniel Nachun
9619f036ac
fix build with newer GCC (#522) 2022-06-06 15:52:55 -07:00
rblanckaert
55a026811a
Sync to upstream/release/530 (#517)
* Run clang-format
* Contains a preliminary implementation of deferred constraint resolution
* Reduce stack usage by some recursive functions
* Fix a bug when smartCloning a BoundTypeVar
* Remove some GC related flags from VM
2022-06-03 15:15:45 -07:00
Rob Blanckaert
871a3a21c5 Sync to origin/release/530 2022-06-03 13:32:20 -07:00
rblanckaert
61766a692c
Sync to upstream/release/529 (#505)
* Adds a currently unused x86-64 assembler as a prerequisite for possible future JIT compilation
* Fix a bug in table iteration (closes Possible table iteration bug #504)
* Improved warning method when function is used as a type
* Fix a bug with unsandboxed iteration with pairs()
* Type of coroutine.status() is now a union of value types
* Bytecode output for tests/debugging now has labels
* Improvements to loop unrolling cost estimation
* Report errors when the key obviously doesn't exist in the table
2022-05-26 15:08:16 -07:00
Rob Blanckaert
c4e05eb7c1 Sync to upstream/release/529 2022-05-26 13:33:48 -07:00
T 'Filtered' C
69acf5ac07
Make coroutine.status use a string literal (#500)
Implements #495 
C++ isn't a language im very familliar with so this might be completely wrong
2022-05-24 11:29:17 -07:00
Arseny Kapoulkine
f5923aefeb
Sync to upstream/release/527 (#491) 2022-05-19 17:02:24 -07:00
Arseny Kapoulkine
7e9e697489 Sync to upstream/release/527 2022-05-19 16:46:52 -07:00
JohnnyMorganz
8b4c6aabc2
Fix findAstAncestry when position is at eof (#490) 2022-05-18 16:26:05 -07:00
JohnnyMorganz
f2191b9e4d
Respect useLineBreaks for union/intersect toString (#487)
* Respect useLineBreaks for union/intersect toString

* Apply suggestions from code review

Co-authored-by: Andy Friesen <andy.friesen@gmail.com>

Co-authored-by: Andy Friesen <andy.friesen@gmail.com>
2022-05-17 11:22:54 -07:00
JohnnyMorganz
ab4bb355a3
Add ToStringOptions.hideFunctionSelfArgument (#486)
Adds an option to hide the `self: type` argument as the first argument in the string representation of a named function type var if the ftv hasSelf.

Also added in a test for the original output (i.e., if the option was disabled)

I didn't apply this option in the normal `Luau::toString()` function, just the `Luau::toStringNamedFunction()` one (for my usecase, that is enough + I felt like a named function would include the method colon `:` to signify self). If this is unintuitive, I can also add it to the general `Luau::toString()` function.
2022-05-16 09:50:15 -07:00