-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add Luau language #6612
Merged
Merged
Add Luau language #6612
Changes from 13 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7febf72
Feature: Add `Luau` language.
robloxiandemo 912f57c
Featire: Add `Luau` code samples.
robloxiandemo 81be622
Feature: Add the grammar.
robloxiandemo 77339ab
Feature: Add `Luau` to grammar index.
robloxiandemo 428f5d2
Fix: Add comment block and change the interpreter.
robloxiandemo 1eced93
Feature: Add new samples in place of the old ones.
robloxiandemo c0dd82e
Patch: Slight typo in the header.
robloxiandemo a3a4286
Patch: Header typos again, I'm such a genius.
robloxiandemo ba342d6
Patch: Introduce the languageId.
robloxiandemo 7463c5f
Patch: Resolve grammar conflict.
robloxiandemo f55cbc5
Patch: Resolve grammar conflict.
robloxiandemo b99f319
Patch: Update the hex value.
robloxiandemo 92bed6f
Patch: Update the hex value.
robloxiandemo 3ae7360
Sort
lildude 5f21201
Patch: Update the submodule to the latest commit.
robloxiandemo 405f7e4
Patch: Resolve merge conflicts.
robloxiandemo f0db075
Patch: Resolve further conflicts.
robloxiandemo 3588fea
Patch: Remove conflict.
robloxiandemo f5eaf45
Patch: Reintroduce Luau into grammar index.
robloxiandemo 1173698
Revert "Patch: Reintroduce Luau into grammar index."
robloxiandemo ec33c7d
Merge branch 'github-linguist:master' into master
robloxiandemo 4d4b3eb
Patch: Retry resolving the conflict issue.
robloxiandemo afcdb27
Update vendor/licenses/git_submodule/Luau.tmLanguage.dep.yml
lildude d005379
Enhancement: Update old samples and their sources.
robloxiandemo 2f9a8a2
Patch: Update old samples and their sources.
robloxiandemo 6f5e853
Merge branch 'master' of https://github.com/robloxiandemo/linguist
robloxiandemo deb5f00
Patch: Update old samples and their sources.
robloxiandemo e3f8ba2
Merge branch 'master' of https://github.com/robloxiandemo/linguist
robloxiandemo f80ee08
Patch: Update old samples and their sources.
robloxiandemo 0c0382a
Merge branch 'master' of https://github.com/robloxiandemo/linguist
robloxiandemo 8fa4f1f
Patch: Update the samples further.
robloxiandemo 481ae46
Revert "Patch: Update old samples and their sources."
robloxiandemo 7bfe7ca
Test: New samples, sadly one source.
robloxiandemo b363c0c
Merge branch 'master' into master
lildude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--// Authored by @sinlerdev (https://github.com/sinlerdev) | ||
--// Fetched from (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/src/Utils/createProcessor.luau) | ||
--// Licensed under the MIT License (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/LICENSE) | ||
|
||
--!strict | ||
local function createProcessor(valueChecker: (a: any, b: any) -> boolean, cleaner: (taskItem: any) -> ()) | ||
return function<T>(old: T, new: T, isDestroying: boolean) | ||
if isDestroying then | ||
cleaner(old) | ||
return false | ||
end | ||
|
||
if valueChecker(old, new) then | ||
return false | ||
end | ||
|
||
cleaner(old) | ||
return true | ||
end | ||
end | ||
|
||
return createProcessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--// Authored by @AmaranthineCodices (https://github.com/AmaranthineCodices) | ||
--// Fetched from (https://github.com/Floral-Abyss/recs/blob/be123afef8f1fddbd9464b7d34d5178393601ae3/recs/createSignal.luau) | ||
--// Licensed under the MIT License (https://github.com/Floral-Abyss/recs/blob/master/LICENSE.md) | ||
|
||
--!strict | ||
|
||
local function createSignal() | ||
local listeners = {} | ||
local signal = {} | ||
|
||
function signal:Connect(listener) | ||
listeners[listener] = true | ||
|
||
local connection = { | ||
Connected = true, | ||
} | ||
|
||
function connection.Disconnect() | ||
connection.Connected = false | ||
listeners[listener] = nil | ||
end | ||
connection.disconnect = connection.Disconnect | ||
|
||
return connection | ||
end | ||
signal.connect = signal.Connect | ||
|
||
local function fire(...) | ||
for listener, _ in pairs(listeners) do | ||
spawn(listener, ...) | ||
end | ||
end | ||
|
||
return signal, fire | ||
end | ||
|
||
return createSignal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--// Authored by @sinlerdev (https://github.com/sinlerdev) | ||
--// Fetched from (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/src/Utils/equals.luau) | ||
--// Licensed under the MIT License (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/LICENSE) | ||
|
||
--!strict | ||
|
||
local function equals(a: any, b: any): boolean | ||
-- INFO: Vinum doesn't officially support immutability currently- so, we just assume | ||
-- that every new table entry is not equal. See issue 26 | ||
if type(a) == "table" then | ||
return false | ||
end | ||
|
||
return a == b | ||
end | ||
|
||
return equals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--// Authored by @benbrimeyer (https://github.com/benbrimeyer) | ||
--// Fetched from (https://github.com/duckarmor/Freeze/blob/670bb6593d8cc54cdcbb96cd94d1273ee0420abb/source/isEmpty.luau) | ||
--// Licensed under the MIT License (https://github.com/duckarmor/Freeze/blob/670bb6593d8cc54cdcbb96cd94d1273ee0420abb/LICENSE) | ||
|
||
--!strict | ||
--[=[ | ||
Returns true if the collection is empty. | ||
|
||
```lua | ||
Freeze.isEmpty({}) | ||
-- true | ||
``` | ||
|
||
@within Freeze | ||
@function isEmpty | ||
@return boolean | ||
]=] | ||
|
||
return function(collection) | ||
return next(collection) == nil | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--// Authored by @benbrimeyer (https://github.com/benbrimeyer) | ||
--// Fetched from (https://github.com/duckarmor/Freeze/blob/670bb6593d8cc54cdcbb96cd94d1273ee0420abb/source/None.luau) | ||
--// Licensed under the MIT License (https://github.com/duckarmor/Freeze/blob/670bb6593d8cc54cdcbb96cd94d1273ee0420abb/LICENSE) | ||
|
||
--[=[ | ||
@prop None None | ||
@within Freeze | ||
|
||
Since lua tables cannot distinguish between values not being present and a value of nil, | ||
`Freeze.None` exists to represent values that should be interpreted as `nil`. | ||
|
||
This is useful when removing values with functions such as [`Freeze.Dictionary.merge`](../api/Dictionary#merge). | ||
]=] | ||
|
||
local None = newproxy(true) | ||
|
||
getmetatable(None).__tostring = function() | ||
return "Freeze.None" | ||
end | ||
|
||
return None |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lildude: based on your comment on #6616, should the tokenizer be taught about
--[[ ]]
and--[====[
/]====]
comments? Or is that only necessary if there are extension ambiguities?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's probably no harm in adding support for this format but it only really comes into play when there are extension ambiguities.