mirror of
https://github.com/ProgramSnail/lang_modes_check.git
synced 2025-12-06 00:58:42 +00:00
better test formatting, etc.
This commit is contained in:
parent
06ccf59e45
commit
ec04e05b7b
3 changed files with 124 additions and 28 deletions
|
|
@ -1,13 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "utils.hpp"
|
||||
#include "types.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace nodes {
|
||||
|
||||
|
|
@ -22,10 +23,10 @@ using ExprPtr = shared_ptr<Expr>;
|
|||
using ExprPtrV = std::vector<ExprPtr>;
|
||||
|
||||
struct Arg : public NodeInfo {
|
||||
Arg(string name, types::Mode mode_hint = {}) : name(std::move(name)), mode_hint(mode_hint) {}
|
||||
Arg(string name, types::Mode mode_hint = {})
|
||||
: name(std::move(name)), mode_hint(mode_hint) {}
|
||||
|
||||
string name;
|
||||
|
||||
types::Mode mode_hint;
|
||||
};
|
||||
|
||||
|
|
@ -110,6 +111,10 @@ inline ExprPtr lambda1(Arg var, ExprPtr expr) {
|
|||
return make_expr<Lambda>(vector<Arg>{var}, std::move(expr));
|
||||
}
|
||||
|
||||
inline ExprPtr lambda2(Arg var1, Arg var2, ExprPtr expr) {
|
||||
return make_expr<Lambda>(vector<Arg>{var1, var2}, std::move(expr));
|
||||
}
|
||||
|
||||
inline ExprPtr operator_call(string name, ExprPtr left, ExprPtr right) {
|
||||
return make_expr<Call>(make_expr<Var>(name), ExprPtrV{left, right});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue