mirror of https://github.com/exaloop/codon.git
Update doxygen
parent
007eaa29de
commit
cbe4e3aca9
|
@ -145,7 +145,7 @@ struct Param : public codon::SrcObject {
|
|||
};
|
||||
|
||||
/// None expression.
|
||||
/// @example None
|
||||
/// @li None
|
||||
struct NoneExpr : public Expr {
|
||||
NoneExpr();
|
||||
NoneExpr(const NoneExpr &expr) = default;
|
||||
|
@ -157,7 +157,7 @@ struct NoneExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Bool expression (value).
|
||||
/// @example True
|
||||
/// @li True
|
||||
struct BoolExpr : public Expr {
|
||||
bool value;
|
||||
|
||||
|
@ -169,9 +169,9 @@ struct BoolExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Int expression (value.suffix).
|
||||
/// @example 12
|
||||
/// @example 13u
|
||||
/// @example 000_010b
|
||||
/// @li 12
|
||||
/// @li 13u
|
||||
/// @li 000_010b
|
||||
struct IntExpr : public Expr {
|
||||
/// Expression value is stored as a string that is parsed during the simplify stage.
|
||||
string value;
|
||||
|
@ -192,9 +192,9 @@ struct IntExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Float expression (value.suffix).
|
||||
/// @example 12.1
|
||||
/// @example 13.15z
|
||||
/// @example e-12
|
||||
/// @li 12.1
|
||||
/// @li 13.15z
|
||||
/// @li e-12
|
||||
struct FloatExpr : public Expr {
|
||||
/// Expression value is stored as a string that is parsed during the simplify stage.
|
||||
string value;
|
||||
|
@ -213,8 +213,8 @@ struct FloatExpr : public Expr {
|
|||
};
|
||||
|
||||
/// String expression (prefix"value").
|
||||
/// @example s'ACGT'
|
||||
/// @example "fff"
|
||||
/// @li s'ACGT'
|
||||
/// @li "fff"
|
||||
struct StringExpr : public Expr {
|
||||
// Vector of {value, prefix} strings.
|
||||
vector<pair<string, string>> strings;
|
||||
|
@ -245,7 +245,7 @@ struct IdExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Star (unpacking) expression (*what).
|
||||
/// @example *args
|
||||
/// @li *args
|
||||
struct StarExpr : public Expr {
|
||||
ExprPtr what;
|
||||
|
||||
|
@ -259,7 +259,7 @@ struct StarExpr : public Expr {
|
|||
};
|
||||
|
||||
/// KeywordStar (unpacking) expression (**what).
|
||||
/// @example **kwargs
|
||||
/// @li **kwargs
|
||||
struct KeywordStarExpr : public Expr {
|
||||
ExprPtr what;
|
||||
|
||||
|
@ -271,7 +271,7 @@ struct KeywordStarExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Tuple expression ((items...)).
|
||||
/// @example (1, a)
|
||||
/// @li (1, a)
|
||||
struct TupleExpr : public Expr {
|
||||
vector<ExprPtr> items;
|
||||
|
||||
|
@ -285,7 +285,7 @@ struct TupleExpr : public Expr {
|
|||
};
|
||||
|
||||
/// List expression ([items...]).
|
||||
/// @example [1, 2]
|
||||
/// @li [1, 2]
|
||||
struct ListExpr : public Expr {
|
||||
vector<ExprPtr> items;
|
||||
|
||||
|
@ -299,7 +299,7 @@ struct ListExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Set expression ({items...}).
|
||||
/// @example {1, 2}
|
||||
/// @li {1, 2}
|
||||
struct SetExpr : public Expr {
|
||||
vector<ExprPtr> items;
|
||||
|
||||
|
@ -311,7 +311,7 @@ struct SetExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Dictionary expression ({(key: value)...}).
|
||||
/// @example {'s': 1, 't': 2}
|
||||
/// @li {'s': 1, 't': 2}
|
||||
struct DictExpr : public Expr {
|
||||
struct DictItem {
|
||||
ExprPtr key, value;
|
||||
|
@ -328,7 +328,7 @@ struct DictExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Generator body node helper [for vars in gen (if conds)...].
|
||||
/// @example for i in lst if a if b
|
||||
/// @li for i in lst if a if b
|
||||
struct GeneratorBody {
|
||||
ExprPtr vars;
|
||||
ExprPtr gen;
|
||||
|
@ -338,8 +338,8 @@ struct GeneratorBody {
|
|||
};
|
||||
|
||||
/// Generator or comprehension expression [(expr (loops...))].
|
||||
/// @example [i for i in j]
|
||||
/// @example (f + 1 for j in k if j for f in j)
|
||||
/// @li [i for i in j]
|
||||
/// @li (f + 1 for j in k if j for f in j)
|
||||
struct GeneratorExpr : public Expr {
|
||||
/// Generator kind: normal generator, list comprehension, set comprehension.
|
||||
enum GeneratorKind { Generator, ListGenerator, SetGenerator };
|
||||
|
@ -356,7 +356,7 @@ struct GeneratorExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Dictionary comprehension expression [{key: expr (loops...)}].
|
||||
/// @example {i: j for i, j in z.items()}
|
||||
/// @li {i: j for i, j in z.items()}
|
||||
struct DictGeneratorExpr : public Expr {
|
||||
ExprPtr key, expr;
|
||||
vector<GeneratorBody> loops;
|
||||
|
@ -369,7 +369,7 @@ struct DictGeneratorExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Conditional expression [cond if ifexpr else elsexpr].
|
||||
/// @example 1 if a else 2
|
||||
/// @li 1 if a else 2
|
||||
struct IfExpr : public Expr {
|
||||
ExprPtr cond, ifexpr, elsexpr;
|
||||
|
||||
|
@ -383,7 +383,7 @@ struct IfExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Unary expression [op expr].
|
||||
/// @example -56
|
||||
/// @li -56
|
||||
struct UnaryExpr : public Expr {
|
||||
string op;
|
||||
ExprPtr expr;
|
||||
|
@ -398,8 +398,8 @@ struct UnaryExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Binary expression [lexpr op rexpr].
|
||||
/// @example 1 + 2
|
||||
/// @example 3 or 4
|
||||
/// @li 1 + 2
|
||||
/// @li 3 or 4
|
||||
struct BinaryExpr : public Expr {
|
||||
string op;
|
||||
ExprPtr lexpr, rexpr;
|
||||
|
@ -417,7 +417,7 @@ struct BinaryExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Chained binary expression.
|
||||
/// @example 1 <= x <= 2
|
||||
/// @li 1 <= x <= 2
|
||||
struct ChainBinaryExpr : public Expr {
|
||||
vector<std::pair<string, ExprPtr>> exprs;
|
||||
|
||||
|
@ -430,7 +430,7 @@ struct ChainBinaryExpr : public Expr {
|
|||
|
||||
/// Pipe expression [(op expr)...].
|
||||
/// op is either "" (only the first item), "|>" or "||>".
|
||||
/// @example a |> b ||> c
|
||||
/// @li a |> b ||> c
|
||||
struct PipeExpr : public Expr {
|
||||
struct Pipe {
|
||||
string op;
|
||||
|
@ -452,7 +452,7 @@ struct PipeExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Index expression (expr[index]).
|
||||
/// @example a[5]
|
||||
/// @li a[5]
|
||||
struct IndexExpr : public Expr {
|
||||
ExprPtr expr, index;
|
||||
|
||||
|
@ -466,7 +466,7 @@ struct IndexExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Call expression (expr((name=value)...)).
|
||||
/// @example a(1, b=2)
|
||||
/// @li a(1, b=2)
|
||||
struct CallExpr : public Expr {
|
||||
/// Each argument can have a name (e.g. foo(1, b=5))
|
||||
struct Arg {
|
||||
|
@ -496,7 +496,7 @@ struct CallExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Dot (access) expression (expr.member).
|
||||
/// @example a.b
|
||||
/// @li a.b
|
||||
struct DotExpr : public Expr {
|
||||
ExprPtr expr;
|
||||
string member;
|
||||
|
@ -513,9 +513,9 @@ struct DotExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Slice expression (st:stop:step).
|
||||
/// @example 1:10:3
|
||||
/// @example s::-1
|
||||
/// @example :::
|
||||
/// @li 1:10:3
|
||||
/// @li s::-1
|
||||
/// @li :::
|
||||
struct SliceExpr : public Expr {
|
||||
/// Any of these can be nullptr to account for partial slices.
|
||||
ExprPtr start, stop, step;
|
||||
|
@ -528,7 +528,7 @@ struct SliceExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Ellipsis expression.
|
||||
/// @example ...
|
||||
/// @li ...
|
||||
struct EllipsisExpr : public Expr {
|
||||
/// True if this is a target partial argument within a PipeExpr.
|
||||
/// If true, this node will be handled differently during the type-checking stage.
|
||||
|
@ -544,7 +544,7 @@ struct EllipsisExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Lambda expression (lambda (vars)...: expr).
|
||||
/// @example lambda a, b: a + b
|
||||
/// @li lambda a, b: a + b
|
||||
struct LambdaExpr : public Expr {
|
||||
vector<string> vars;
|
||||
ExprPtr expr;
|
||||
|
@ -557,7 +557,7 @@ struct LambdaExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Yield (send to generator) expression.
|
||||
/// @example (yield)
|
||||
/// @li (yield)
|
||||
struct YieldExpr : public Expr {
|
||||
YieldExpr();
|
||||
YieldExpr(const YieldExpr &expr) = default;
|
||||
|
@ -567,7 +567,7 @@ struct YieldExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Assignment (walrus) expression (var := expr).
|
||||
/// @example a := 5 + 3
|
||||
/// @li a := 5 + 3
|
||||
struct AssignExpr : public Expr {
|
||||
ExprPtr var, expr;
|
||||
|
||||
|
@ -580,7 +580,7 @@ struct AssignExpr : public Expr {
|
|||
|
||||
/// Range expression (start ... end).
|
||||
/// Used only in match-case statements.
|
||||
/// @example 1 ... 2
|
||||
/// @li 1 ... 2
|
||||
struct RangeExpr : public Expr {
|
||||
ExprPtr start, stop;
|
||||
|
||||
|
@ -596,7 +596,7 @@ struct RangeExpr : public Expr {
|
|||
/// Statement expression (stmts...; expr).
|
||||
/// Statements are evaluated only if the expression is evaluated
|
||||
/// (to support short-circuiting).
|
||||
/// @example (a = 1; b = 2; a + b)
|
||||
/// @li (a = 1; b = 2; a + b)
|
||||
struct StmtExpr : public Expr {
|
||||
vector<shared_ptr<Stmt>> stmts;
|
||||
ExprPtr expr;
|
||||
|
@ -613,7 +613,7 @@ struct StmtExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Pointer expression (__ptr__(expr)).
|
||||
/// @example __ptr__(a)
|
||||
/// @li __ptr__(a)
|
||||
struct PtrExpr : public Expr {
|
||||
ExprPtr expr;
|
||||
|
||||
|
@ -625,7 +625,7 @@ struct PtrExpr : public Expr {
|
|||
};
|
||||
|
||||
/// Static tuple indexing expression (expr[index]).
|
||||
/// @example (1, 2, 3)[2]
|
||||
/// @li (1, 2, 3)[2]
|
||||
struct TupleIndexExpr : Expr {
|
||||
ExprPtr expr;
|
||||
int index;
|
||||
|
@ -638,7 +638,7 @@ struct TupleIndexExpr : Expr {
|
|||
};
|
||||
|
||||
/// Static tuple indexing expression (expr[index]).
|
||||
/// @example (1, 2, 3)[2]
|
||||
/// @li (1, 2, 3)[2]
|
||||
struct InstantiateExpr : Expr {
|
||||
ExprPtr typeExpr;
|
||||
vector<ExprPtr> typeParams;
|
||||
|
@ -653,7 +653,7 @@ struct InstantiateExpr : Expr {
|
|||
};
|
||||
|
||||
/// Stack allocation expression (__array__[type](expr)).
|
||||
/// @example __array__[int](5)
|
||||
/// @li __array__[int](5)
|
||||
struct StackAllocExpr : Expr {
|
||||
ExprPtr typeExpr, expr;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
using StmtPtr = shared_ptr<Stmt>;
|
||||
|
||||
/// Suite (block of statements) statement (stmt...).
|
||||
/// @example a = 5; foo(1)
|
||||
/// @li a = 5; foo(1)
|
||||
struct SuiteStmt : public Stmt {
|
||||
using Stmt::Stmt;
|
||||
|
||||
|
@ -99,7 +99,7 @@ struct SuiteStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Break statement.
|
||||
/// @example break
|
||||
/// @li break
|
||||
struct BreakStmt : public Stmt {
|
||||
BreakStmt() = default;
|
||||
BreakStmt(const BreakStmt &stmt) = default;
|
||||
|
@ -109,7 +109,7 @@ struct BreakStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Continue statement.
|
||||
/// @example continue
|
||||
/// @li continue
|
||||
struct ContinueStmt : public Stmt {
|
||||
ContinueStmt() = default;
|
||||
ContinueStmt(const ContinueStmt &stmt) = default;
|
||||
|
@ -119,7 +119,7 @@ struct ContinueStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Expression statement (expr).
|
||||
/// @example 3 + foo()
|
||||
/// @li 3 + foo()
|
||||
struct ExprStmt : public Stmt {
|
||||
ExprPtr expr;
|
||||
|
||||
|
@ -133,9 +133,9 @@ struct ExprStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Assignment statement (lhs: type = rhs).
|
||||
/// @example a = 5
|
||||
/// @example a: Optional[int] = 5
|
||||
/// @example a, b, c = 5, *z
|
||||
/// @li a = 5
|
||||
/// @li a: Optional[int] = 5
|
||||
/// @li a, b, c = 5, *z
|
||||
struct AssignStmt : public Stmt {
|
||||
ExprPtr lhs, rhs, type;
|
||||
/// True if assignment always shadows existing variables. For internal use (e.g.
|
||||
|
@ -152,8 +152,8 @@ struct AssignStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Deletion statement (del expr).
|
||||
/// @example del a
|
||||
/// @example del a[5]
|
||||
/// @li del a
|
||||
/// @li del a[5]
|
||||
struct DelStmt : public Stmt {
|
||||
ExprPtr expr;
|
||||
|
||||
|
@ -165,7 +165,7 @@ struct DelStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Print statement (print expr).
|
||||
/// @example print a, b
|
||||
/// @li print a, b
|
||||
struct PrintStmt : public Stmt {
|
||||
vector<ExprPtr> items;
|
||||
/// True if there is a dangling comma after print: print a,
|
||||
|
@ -179,8 +179,8 @@ struct PrintStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Return statement (return expr).
|
||||
/// @example return
|
||||
/// @example return a
|
||||
/// @li return
|
||||
/// @li return a
|
||||
struct ReturnStmt : public Stmt {
|
||||
/// nullptr if this is an empty return/yield statements.
|
||||
ExprPtr expr;
|
||||
|
@ -193,8 +193,8 @@ struct ReturnStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Yield statement (yield expr).
|
||||
/// @example yield
|
||||
/// @example yield a
|
||||
/// @li yield
|
||||
/// @li yield a
|
||||
struct YieldStmt : public Stmt {
|
||||
/// nullptr if this is an empty return/yield statements.
|
||||
ExprPtr expr;
|
||||
|
@ -207,8 +207,8 @@ struct YieldStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Assert statement (assert expr).
|
||||
/// @example assert a
|
||||
/// @example assert a, "Message"
|
||||
/// @li assert a
|
||||
/// @li assert a, "Message"
|
||||
struct AssertStmt : public Stmt {
|
||||
ExprPtr expr;
|
||||
/// nullptr if there is no message.
|
||||
|
@ -222,8 +222,8 @@ struct AssertStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// While loop statement (while cond: suite; else: elseSuite).
|
||||
/// @example while True: print
|
||||
/// @example while True: break
|
||||
/// @li while True: print
|
||||
/// @li while True: break
|
||||
/// else: print
|
||||
struct WhileStmt : public Stmt {
|
||||
ExprPtr cond;
|
||||
|
@ -239,8 +239,8 @@ struct WhileStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// For loop statement (for var in iter: suite; else elseSuite).
|
||||
/// @example for a, b in c: print
|
||||
/// @example for i in j: break
|
||||
/// @li for a, b in c: print
|
||||
/// @li for i in j: break
|
||||
/// else: print
|
||||
struct ForStmt : public Stmt {
|
||||
ExprPtr var;
|
||||
|
@ -262,10 +262,10 @@ struct ForStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// If block statement (if cond: suite; (elif cond: suite)...).
|
||||
/// @example if a: foo()
|
||||
/// @example if a: foo()
|
||||
/// @li if a: foo()
|
||||
/// @li if a: foo()
|
||||
/// elif b: bar()
|
||||
/// @example if a: foo()
|
||||
/// @li if a: foo()
|
||||
/// elif b: bar()
|
||||
/// else: baz()
|
||||
struct IfStmt : public Stmt {
|
||||
|
@ -281,7 +281,7 @@ struct IfStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Match statement (match what: (case pattern: case)...).
|
||||
/// @example match a:
|
||||
/// @li match a:
|
||||
/// case 1: print
|
||||
/// case _: pass
|
||||
struct MatchStmt : public Stmt {
|
||||
|
@ -308,12 +308,12 @@ struct MatchStmt : public Stmt {
|
|||
/// - import what (as as)
|
||||
/// - from c import what(args...) (-> ret) (as as)
|
||||
/// - from .(dots...)from import what (as as)
|
||||
/// @example import a
|
||||
/// @example from b import a
|
||||
/// @example from ...b import a as ai
|
||||
/// @example from c import foo(int) -> int as bar
|
||||
/// @example from python.numpy import array
|
||||
/// @example from python import numpy.array(int) -> int as na
|
||||
/// @li import a
|
||||
/// @li from b import a
|
||||
/// @li from ...b import a as ai
|
||||
/// @li from c import foo(int) -> int as bar
|
||||
/// @li from python.numpy import array
|
||||
/// @li from python import numpy.array(int) -> int as na
|
||||
struct ImportStmt : public Stmt {
|
||||
ExprPtr from, what;
|
||||
string as;
|
||||
|
@ -333,7 +333,7 @@ struct ImportStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Try-catch statement (try: suite; (catch var (as exc): suite)...; finally: finally).
|
||||
/// @example: try: a
|
||||
/// @li: try: a
|
||||
/// catch e: pass
|
||||
/// catch e as Exc: pass
|
||||
/// catch: pass
|
||||
|
@ -362,7 +362,7 @@ struct TryStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Throw statement (raise expr).
|
||||
/// @example: raise a
|
||||
/// @li: raise a
|
||||
struct ThrowStmt : public Stmt {
|
||||
ExprPtr expr;
|
||||
// True if a statement was transformed during type-checking stage
|
||||
|
@ -377,7 +377,7 @@ struct ThrowStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Global variable statement (global var).
|
||||
/// @example: global a
|
||||
/// @li: global a
|
||||
struct GlobalStmt : public Stmt {
|
||||
string var;
|
||||
|
||||
|
@ -423,7 +423,7 @@ struct Attr {
|
|||
};
|
||||
|
||||
/// Function statement (@(attributes...) def name[funcs...](args...) -> ret: suite).
|
||||
/// @example: @decorator
|
||||
/// @li: @decorator
|
||||
/// def foo[T=int, U: int](a, b: int = 0) -> list[T]: pass
|
||||
struct FunctionStmt : public Stmt {
|
||||
string name;
|
||||
|
@ -443,7 +443,7 @@ struct FunctionStmt : public Stmt {
|
|||
|
||||
/// @return a function signature that consists of generics and arguments in a
|
||||
/// S-expression form.
|
||||
/// @example (T U (int 0))
|
||||
/// @li (T U (int 0))
|
||||
string signature() const;
|
||||
bool hasAttr(const string &attr) const;
|
||||
|
||||
|
@ -451,7 +451,7 @@ struct FunctionStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Class statement (@(attributes...) class name[generics...]: args... ; suite).
|
||||
/// @example: @type
|
||||
/// @li: @type
|
||||
/// class F[T]:
|
||||
/// m: T
|
||||
/// def __new__() -> F[T]: ...
|
||||
|
@ -478,7 +478,7 @@ struct ClassStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Yield-from statement (yield from expr).
|
||||
/// @example: yield from it
|
||||
/// @li: yield from it
|
||||
struct YieldFromStmt : public Stmt {
|
||||
ExprPtr expr;
|
||||
|
||||
|
@ -490,7 +490,7 @@ struct YieldFromStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// With statement (with (item as var)...: suite).
|
||||
/// @example: with foo(), bar() as b: pass
|
||||
/// @li: with foo(), bar() as b: pass
|
||||
struct WithStmt : public Stmt {
|
||||
vector<ExprPtr> items;
|
||||
/// empty string if a corresponding item is unnamed
|
||||
|
@ -506,7 +506,7 @@ struct WithStmt : public Stmt {
|
|||
};
|
||||
|
||||
/// Custom block statement (foo: ...).
|
||||
/// @example: pt_tree: pass
|
||||
/// @li: pt_tree: pass
|
||||
struct CustomStmt : public Stmt {
|
||||
string keyword;
|
||||
ExprPtr expr;
|
||||
|
@ -522,7 +522,7 @@ struct CustomStmt : public Stmt {
|
|||
/// The following nodes are created after the simplify stage.
|
||||
|
||||
/// Member assignment statement (lhs.member = rhs).
|
||||
/// @example: a.x = b
|
||||
/// @li: a.x = b
|
||||
struct AssignMemberStmt : public Stmt {
|
||||
ExprPtr lhs;
|
||||
string member;
|
||||
|
@ -537,7 +537,7 @@ struct AssignMemberStmt : public Stmt {
|
|||
|
||||
/// Update assignment statement (lhs = rhs).
|
||||
/// Only valid if lhs exists.
|
||||
/// @example: lhs = rhs
|
||||
/// @li: lhs = rhs
|
||||
struct UpdateStmt : public Stmt {
|
||||
ExprPtr lhs, rhs;
|
||||
/// True if this is an atomic update.
|
||||
|
|
|
@ -348,10 +348,10 @@ private:
|
|||
/// Converts a Python-like F-string (f"foo {x+1} bar") to a concatenation:
|
||||
/// str.cat("foo ", str(x + 1), " bar").
|
||||
/// Also supports "{x=}" specifier (that prints the raw expression as well).
|
||||
/// @example f"{x+1=}" becomes str.cat(["x+1=", str(x+1)]).
|
||||
/// @li f"{x+1=}" becomes str.cat(["x+1=", str(x+1)]).
|
||||
ExprPtr transformFString(string value);
|
||||
/// Transforms a list of GeneratorBody loops to a corresponding set of statements.
|
||||
/// @example (for i in j if a for k in i if a if b) becomes:
|
||||
/// @li (for i in j if a for k in i if a if b) becomes:
|
||||
/// for i in j: if a: for k in i: if a: if b: <prev>
|
||||
/// @param prev (out-argument) A pointer to the innermost block (suite) where a
|
||||
/// comprehension (or generator) expression should reside.
|
||||
|
@ -361,7 +361,7 @@ private:
|
|||
/// If the statements refer to outer variables, those variables will be captured and
|
||||
/// added to the list of arguments. Returns a call expression that calls this
|
||||
/// function with captured variables.
|
||||
/// @example Given a statement a+b and argument names a, this generates
|
||||
/// @li Given a statement a+b and argument names a, this generates
|
||||
/// def _lambda(a, b): return a+b
|
||||
/// and returns
|
||||
/// _lambda(b).
|
||||
|
|
|
@ -318,7 +318,7 @@ public:
|
|||
|
||||
/// Constructs a yield in instruction.
|
||||
/// @param type the type of the value being yielded in
|
||||
/// @param supsend whether to suspend
|
||||
/// @param suspend whether to suspend
|
||||
/// @param name the instruction's name
|
||||
explicit YieldInInstr(types::Type *type, bool suspend = true, std::string name = "")
|
||||
: AcceptorExtend(std::move(name)), type(type), suspend(suspend) {}
|
||||
|
|
|
@ -55,7 +55,7 @@ struct function_iterator_adaptor {
|
|||
};
|
||||
|
||||
/// Creates an adaptor that dereferences values.
|
||||
/// @param the internal iterator
|
||||
/// @param it the internal iterator
|
||||
/// @return the adaptor
|
||||
template <typename It> auto dereference_adaptor(It it) {
|
||||
auto f = [](const auto &v) -> auto & { return *v; };
|
||||
|
@ -65,7 +65,7 @@ template <typename It> auto dereference_adaptor(It it) {
|
|||
}
|
||||
|
||||
/// Creates an adaptor that gets the address of its values.
|
||||
/// @param the internal iterator
|
||||
/// @param it the internal iterator
|
||||
/// @return the adaptor
|
||||
template <typename It> auto raw_ptr_adaptor(It it) {
|
||||
auto f = [](auto &v) -> auto * { return v.get(); };
|
||||
|
@ -75,7 +75,7 @@ template <typename It> auto raw_ptr_adaptor(It it) {
|
|||
}
|
||||
|
||||
/// Creates an adaptor that gets the const address of its values.
|
||||
/// @param the internal iterator
|
||||
/// @param it the internal iterator
|
||||
/// @return the adaptor
|
||||
template <typename It> auto const_raw_ptr_adaptor(It it) {
|
||||
auto f = [](auto &v) -> const auto * { return v.get(); };
|
||||
|
@ -85,7 +85,7 @@ template <typename It> auto const_raw_ptr_adaptor(It it) {
|
|||
}
|
||||
|
||||
/// Creates an adaptor that gets the keys of its values.
|
||||
/// @param the internal iterator
|
||||
/// @param it the internal iterator
|
||||
/// @return the adaptor
|
||||
template <typename It> auto map_key_adaptor(It it) {
|
||||
auto f = [](auto &v) -> auto & { return v.first; };
|
||||
|
@ -95,7 +95,7 @@ template <typename It> auto map_key_adaptor(It it) {
|
|||
}
|
||||
|
||||
/// Creates an adaptor that gets the const keys of its values.
|
||||
/// @param the internal iterator
|
||||
/// @param it the internal iterator
|
||||
/// @return the adaptor
|
||||
template <typename It> auto const_map_key_adaptor(It it) {
|
||||
auto f = [](auto &v) -> const auto & { return v.first; };
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
PROJECT_NAME = "codon"
|
||||
PROJECT_NAME = "Codon"
|
||||
XML_OUTPUT = xml
|
||||
INPUT = ../../compiler/include ../../compiler/lang ../../compiler/types ../../compiler/util
|
||||
INPUT = ../../codon
|
||||
EXCLUDE_PATTERNS = */codon/util/fmt/* */codon/sir/llvm/coro/*
|
||||
STRIP_FROM_PATH = ../..
|
||||
GENERATE_LATEX = NO
|
||||
GENERATE_MAN = NO
|
||||
|
@ -12,4 +13,3 @@ RECURSIVE = YES
|
|||
QUIET = YES
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
|
||||
|
|
Loading…
Reference in New Issue