-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move over-max-arg packing to analysis
- Loading branch information
Showing
14 changed files
with
278 additions
and
94 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma once | ||
|
||
#include <jank/analyze/expression_base.hpp> | ||
|
||
namespace jank::analyze::expr | ||
{ | ||
using namespace jank::runtime; | ||
|
||
template <typename E> | ||
struct list : expression_base | ||
{ | ||
native_vector<native_box<E>> data_exprs; | ||
option<object_ptr> meta; | ||
obj::persistent_list_ptr data{}; | ||
|
||
void propagate_position(expression_position const pos) | ||
{ | ||
position = pos; | ||
} | ||
|
||
object_ptr to_runtime_data() const | ||
{ | ||
object_ptr exprs(make_box<obj::persistent_vector>()); | ||
for(auto const &e : data_exprs) | ||
{ | ||
exprs = conj(exprs, e->to_runtime_data()); | ||
} | ||
|
||
return merge(static_cast<expression_base const *>(this)->to_runtime_data(), | ||
obj::persistent_array_map::create_unique(make_box("__type"), | ||
make_box("expr::list"), | ||
make_box("data_exprs"), | ||
exprs, | ||
make_box("meta"), | ||
jank::detail::to_runtime_data(meta))); | ||
} | ||
}; | ||
} |
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
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
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
Oops, something went wrong.