MCPcopy Create free account
hub / github.com/aspizu/goboscript / expr

Method expr

src/codegen/sb3.rs:1174–1212  ·  view source on GitHub ↗
(
        &mut self,
        s: S,
        d: D,
        expr: &Expr,
        this_id: NodeID,
        parent_id: NodeID,
    )

Source from the content-addressed store, hash-verified

1172 }
1173
1174 pub fn expr(
1175 &mut self,
1176 s: S,
1177 d: D,
1178 expr: &Expr,
1179 this_id: NodeID,
1180 parent_id: NodeID,
1181 ) -> io::Result<()> {
1182 match expr {
1183 Expr::Value { .. } => Ok(()),
1184 Expr::Name { .. } => Ok(()),
1185 Expr::Arg(name) => self.arg(s, d, this_id, parent_id, name),
1186 Expr::Repr { repr, span, args } => {
1187 self.repr(s, d, this_id, parent_id, repr, span, args)
1188 }
1189 Expr::FuncCall { name, span, .. } => {
1190 d.report(DiagnosticKind::UnrecognizedFunction(name.clone()), span);
1191 Ok(())
1192 }
1193 Expr::UnOp { op, opr, .. } => self.un_op(s, d, this_id, parent_id, op, opr),
1194 Expr::BinOp { op, lhs, rhs, .. } => self.bin_op(s, d, this_id, parent_id, op, lhs, rhs),
1195 Expr::StructLiteral { name, span, .. } => {
1196 d.report(
1197 DiagnosticKind::TypeMismatch {
1198 expected: Type::Value,
1199 given: Type::Struct {
1200 name: name.clone(),
1201 span: span.clone(),
1202 },
1203 },
1204 &expr.span(),
1205 );
1206 Ok(())
1207 }
1208 Expr::Dot { lhs, rhs, rhs_span } => {
1209 self.expr_dot(s, d, this_id, parent_id, lhs, rhs, rhs_span.clone())
1210 }
1211 }
1212 }
1213}

Callers 15

repeatMethod · 0.80
branchMethod · 0.80
untilMethod · 0.80
set_varMethod · 0.80
change_varMethod · 0.80
add_to_listMethod · 0.80
delete_list_indexMethod · 0.80
list_insertMethod · 0.80
blockMethod · 0.80
proc_call_implMethod · 0.80
on_loudness_gtMethod · 0.80
on_timer_gtMethod · 0.80

Calls 7

argMethod · 0.80
reprMethod · 0.80
reportMethod · 0.80
expr_dotMethod · 0.80
un_opMethod · 0.45
bin_opMethod · 0.45
spanMethod · 0.45

Tested by

no test coverage detected