MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / assign

Method assign

compiler/src/modules/parser/stmt.rs:670–685  ·  view source on GitHub ↗
(&mut self, name: String)

Source from the content-addressed store, hash-verified

668 }
669
670 pub(super) fn assign(&mut self, name: String) {
671 self.advance();
672 self.expr();
673 // `x = 1,` / `x = 1, 2`: a trailing comma builds a tuple right-hand side.
674 if matches!(self.peek_same_line(), Some(TokenType::Comma)) {
675 let mut count = 1u16;
676 while self.eat_if(TokenType::Comma) {
677 // A line boundary ends the tuple; `peek_same_line` won't cross the Newline.
678 if self.peek_same_line().is_none() { break; }
679 self.expr();
680 count += 1;
681 }
682 self.chunk.emit(OpCode::BuildTuple, count);
683 }
684 self.store_name(name);
685 }
686}

Callers 6

domFunction · 0.80
networkFunction · 0.80
storageFunction · 0.80
timeFunction · 0.80
name_stmtMethod · 0.80
nameMethod · 0.80

Calls 7

advanceMethod · 0.80
exprMethod · 0.80
eat_ifMethod · 0.80
is_noneMethod · 0.80
peek_same_lineMethod · 0.80
emitMethod · 0.80
store_nameMethod · 0.80

Tested by

no test coverage detected