Commit graph

1324 commits

Author SHA1 Message Date
Alex Hansen
dff6b2024a
Re-specify pest version. (#594)
* try to fix pest dep

* specify fuel pest deps

Co-authored-by: Alexander Hansen <alexanderhansen@AlexandersMBP3.home>
2022-01-07 11:34:41 -08:00
m-fawaz
5a12e9acb3
Handle multiple imports in one use statement (#584)
* First working draft to enable multi item import in a single use statement

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Minor clean-up changes

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* More minor clean-up changes

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* More minor clean-up changes

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Propertly handling aliases for the basic case

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Trying a recursive solution

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* updating a few tests to use the new supported syntax

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Fixing formatting issues

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Adding a test

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Fixing formatting issues

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Additional features: Handling non-final asterisks and trailing aliases after "}"

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Better naming for one of the variables

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* Addressing Clippy's warnings

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>

* reducing the size of the new test

Signed-off-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>
2022-01-07 10:41:21 -08:00
John Adler
38479274e0
Bump to v0.2.0. (#592) 2022-01-06 17:57:51 -05:00
Alex Hansen
84101e0624
fix trait implementation imports in star imports (#588)
* fix trait implementation imports in star imports

* Fix test case

* remove rust test harness

* add json abi oracle

Co-authored-by: Alexander Hansen <alexanderhansen@AlexandersMBP3.home>
2022-01-06 13:37:51 -08:00
Chris O'Brien
c55f7e76b0
clippy doesn't fail on warnings (#583)
* clippy doesn't fail on warnings

* Update clippy_check.yml

* fixed lints
2022-01-06 13:22:03 -06:00
Toby Hutton
9ae17595ab
Rename the arg to unowned_stack_allocate_memory(). (#586)
It was `size_to_allocate_in_words` which is misleading.  Changed to `size_to_allocate_in_bytes`.
2022-01-06 09:55:30 -08:00
Emily Herbert
2849a8d378
Implement tuple desugaring in match expressions (#573)
* Test case.

* Parsing, type checking, dead code analysis complete. WIP

* Lock file update.

* Implement tuple desugaring.

* Turn silent mode back on.

* More complicated test case.

* Apply clippy lint.

* Update sway-core/src/semantic_analysis/ast_node/expression/typed_expression_variant.rs

Co-authored-by: Alex Hansen <alex@alex-hansen.com>

Co-authored-by: Alex Hansen <alex@alex-hansen.com>
2022-01-06 09:55:18 -08:00
Emily Herbert
a41a3f3bbb
Disallow type name shadowing. (#462)
* Error on override struct name.

* Integrate code review comments.

* Update sway-core/src/error.rs

Co-authored-by: Alex Hansen <alex@alex-hansen.com>

* Update sway-core/src/error.rs

Co-authored-by: Alex Hansen <alex@alex-hansen.com>

* Fix license.

Co-authored-by: John Adler <john.adler@protonmail.ch>
Co-authored-by: Alex Hansen <alex@alex-hansen.com>
2022-01-05 16:59:52 -06:00
Andrew Cann
ff6f914e28
Store source in an Arc<str> (#483)
* make fields of Ident private

* Make Ident<'sc> not hold a &'sc str

* rename Ident::primary_name to Ident::as_str

* impl fmt::Display for Ident

* use Idents in warnings, rather than str

* use Idents in CompileError rather than &str

* switch to static spans

* remove pest dependency from forc and sway-server

* use Arc-based pest from github

* fix clippy lints

* remove remaining unused 'sc lifetimes

* run rustfmt
2022-01-05 05:51:19 -08:00
Andrew Cann
32caf24974
Implement tuples (#399)
* replace TypeInfo::Unit with TypeInfo::Tuple

* Also parsing unit types in return position

* replace unit expressions with tuple expressions

* re-use struct asm generation for tuples

* implement dead code analysis for tuples

* implement parsing for tuple types

* make tuple types hold TypeIds rather than TypeInfos

* allow parsing single-field tuples

* run rustfmt
2022-01-04 10:20:33 -08:00
Chris O'Brien
1ba79ac792
Clippy Lint Workflow (#477)
* draft of clippy lint workflow

* testing yml

* Update .github/workflows/clippy_check.yml

remove redundant keys

Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>

* Update .github/workflows/clippy_check.yml

`core-lang` changed to `sway-core`

Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>

* Update clippy_check.yml

Added `with:` to complete syntax

* Token Required

Testing if the generic github token is enough for Clippy Check to run

* specify args

* fix selector debug binary

* forc lint & update clippy-workflow

* formatting

* update args

* Requested changes

Removed `path`

Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Alex Hansen <alex@alex-hansen.com>
2022-01-01 15:43:37 -06:00
Chris O'Brien
e118d8848e
Added more documentation & small fixes (#455)
* example docs

* type refactor

* Document lib.rs

* document modules

* fix typo

* removed merge conflict markers

* added parse functionality to  function use example

* Added more documentation, and small fixes

* accepted incoming changes

* small fix that got reverted

* Update core_lang/src/ident.rs

Co-authored-by: Alex Hansen <alex@alex-hansen.com>

* Update core_lang/src/parse_tree/expression/mod.rs

Co-authored-by: Alex Hansen <alex@alex-hansen.com>

* Update core_lang/src/span.rs

Co-authored-by: Alex Hansen <alex@alex-hansen.com>

* Update to docstring for `Ident`

Added note for distinction between "symbols" and "tokens".

* added more docs for review

* added UseStatement

* formatting

* Added hyperlinks and fixed local broken link

* Requested changes to docs

* Requested changes

Co-authored-by: Alex Hansen <alex@alex-hansen.com>
Co-authored-by: John Adler <john.adler@protonmail.ch>
2021-12-31 22:51:37 -06:00
Chris O'Brien
c78751b92c
sway-core lints (#546) 2021-12-31 22:50:43 -06:00
John Adler
6fe6354eb9
Bump to 0.1.9 (#536) 2021-12-29 21:36:37 -05:00
Alex Hansen
933c1def2b
Fix incorrect type check unification on then branches (#535)
* Fix error in if expression then branch type checking

* bump to 0.1.8

* fix fmt

* Revert version bump.

Co-authored-by: John Adler <john.adler@protonmail.ch>
2021-12-29 18:22:31 -08:00
Alex Hansen
4038415bf9
Search all namespaces for implemented traits, not just the local one (#532)
* Search all namespaces for implemented traits, not just the local one

* add json abi oracle

* fix oracle...
2021-12-29 11:44:11 -08:00
John Adler
a38a89a042
Bump to v0.1.6. (#525) 2021-12-28 17:13:38 -05:00
Alex Hansen
54c4efe69a
better error handling for literal number parsing (#524) 2021-12-28 13:22:39 -08:00
John Adler
1923f44784
Bump to v0.1.5. (#510) 2021-12-27 20:48:24 -05:00
John Adler
46305882aa
Bump to v0.1.4. (#496) 2021-12-25 17:33:24 -05:00
John Adler
d30d3225a3
Use exact dependency version for serde_json (#494)
* Use exact dep version.

* Bump version to 0.1.3.
2021-12-25 11:45:06 -08:00
John Adler
2431af753e
Update lockfile (#493)
* Update lockfile.

* Fix API break in lsp-types (dep of lspower).

* Bump version to v0.1.2.

* Bump version.

* Remove warnings.
2021-12-25 09:24:34 -08:00
John Adler
8a37329cb1
Use exact version for local deps. (#490) 2021-12-24 22:25:11 -08:00
Alex Hansen
90c9b56a7f
Rename core_lang to core-lang, core-types to sway-types, and update dependencies to use crates.io (#486)
* Rename core_lang to core-lang

* update workspace to sway-types

* Rename

* update readme

* add verifys cript

* update ci

* update some names

* fix

* rename formatter to sway-fmt

* rename core-lang to sway-core

* specify version for sway fmt

* Prevent publishing.

* add sway server to check

* alpha

* Update manifest files.

* Remove duplicate core types.

* update test harness; use crates.io for fuel-client

* formatting

* forgotten add

* update fuel-core test

* run fuel-core in the background

* update README

* kill fuel-core after use

* yaml tweak

Co-authored-by: John Adler <john.adler@protonmail.ch>
2021-12-24 19:40:54 -05:00