Skip to content

Commit

Permalink
Add buffer library to Luau standard library (#566)
Browse files Browse the repository at this point in the history
This adds the buffer library to the Luau standard library.

I tried my best to sort them in alphabetical order but it was done by
hand, so there's a chance I made a mistake.
  • Loading branch information
Dekkonot authored Nov 8, 2023
1 parent a38a7bf commit 92afa63
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- When given in standard library format, additional information now shows up in `incorrect_standard_library_use` missing required parameter errors.
- Added new [`mixed_table` lint](https://kampfkarren.github.io/selene/lints/mixed_table.html), which will warn against mixed tables.
- Added `bit32.byteswap` to Luau standard library
- Added `buffer` library to Luau standard library

### Fixed
- `string.pack` and `string.unpack` now have proper function signatures in the Lua 5.3 standard library.
Expand Down
148 changes: 148 additions & 0 deletions selene-lib/default_std/luau.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,154 @@ globals:
- type: number
- type: number
must_use: true
buffer.copy:
args:
- type:
display: buffer
- type: number
- type:
display: buffer
- required: false
type: number
- required: false
type: number
buffer.create:
args:
- type: number
must_use: true
buffer.fill:
args:
- type:
display: buffer
- type: number
- type: number
- required: false
type: number
buffer.fromstring:
args:
- type: string
must_use: true
buffer.len:
args:
- type:
display: buffer
must_use: true
buffer.readf32:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readf64:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readi8:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readi16:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readi32:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readstring:
args:
- type:
display: buffer
- type: number
- type: number
must_use: true
buffer.readu8:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readu16:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.readu32:
args:
- type:
display: buffer
- type: number
must_use: true
buffer.tostring:
args:
- type:
display: buffer
must_use: true
buffer.writef32:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writef64:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writei8:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writei16:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writei32:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writestring:
args:
- type:
display: buffer
- type: number
- type: string
- required: false
type: number
buffer.writeu8:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writeu16:
args:
- type:
display: buffer
- type: number
- type: number
buffer.writeu32:
args:
- type:
display: buffer
- type: number
- type: number
collectgarbage:
args:
- type:
Expand Down

0 comments on commit 92afa63

Please sign in to comment.