Skip to content
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

Support Behaviors #678

Merged
merged 8 commits into from
Jul 4, 2021
Merged

Support Behaviors #678

merged 8 commits into from
Jul 4, 2021

Conversation

water111
Copy link
Collaborator

@water111 water111 commented Jul 4, 2021

In a lambda:

(lambda :behavior type-name (binding..) body...)

in a global function:

(defbehavior func-name type-name (binding...) [docstring] body...)

in a method (only in the deftype)

(method-name (arg-type...) return-type [:behavior type-name] [assert-id])

in a typespec

(type-name (arg...) [:behavior type-name])

In a behavior, the self variable is mapped to the process register and has the type of the behavior.

Also some silly changes to TypeSpec.cpp to make it faster.

@coveralls
Copy link

coveralls commented Jul 4, 2021

Pull Request Test Coverage Report for Build 999103518

  • 403 of 484 (83.26%) changed or added relevant lines in 14 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.1%) to 69.111%

Changes Missing Coverage Covered Lines Changed/Added Lines %
goalc/compiler/compilation/Type.cpp 17 18 94.44%
goalc/compiler/compilation/Function.cpp 18 20 90.0%
test/test_common_util.cpp 104 106 98.11%
common/type_system/TypeSpec.h 49 52 94.23%
decompiler/analysis/expression_build.cpp 1 4 25.0%
common/type_system/deftype.cpp 19 23 82.61%
common/util/SmallVector.h 137 143 95.8%
common/type_system/TypeSystem.cpp 14 25 56.0%
decompiler/IR2/Env.cpp 4 18 22.22%
decompiler/analysis/final_output.cpp 6 20 30.0%
Files with Coverage Reduction New Missed Lines %
common/type_system/TypeSystem.cpp 2 70.96%
decompiler/IR2/Env.cpp 2 60.99%
Totals Coverage Status
Change from base Build 997641364: 0.1%
Covered Lines: 37550
Relevant Lines: 54333

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants