MCPcopy Create free account
hub / github.com/d0iasm/saba / parse_ast

Method parse_ast

core/src/renderer/js/ast.rs:542–562  ·  view source on GitHub ↗

SourceElements ::= ( SourceElement )+ Program ::= ( SourceElements )?

(&mut self)

Source from the content-addressed store, hash-verified

540 ///
541 /// Program ::= ( SourceElements )? <EOF>
542 pub fn parse_ast(&mut self) -> Program {
543 let mut program = Program::new();
544
545 // interface Program <: Node {
546 // type: "Program";
547 // body: [ Directive | Statement ];
548 // }
549 let mut body = Vec::new();
550
551 loop {
552 let node = self.source_element();
553
554 match node {
555 Some(n) => body.push(n),
556 None => {
557 program.set_body(body);
558 return program;
559 }
560 }
561 }
562 }
563}
564
565#[cfg(test)]

Callers 12

execute_jsMethod · 0.80
test_numFunction · 0.80
test_add_numsFunction · 0.80
test_sub_numsFunction · 0.80
test_assign_variableFunction · 0.80
test_reassign_variableFunction · 0.80
test_reassign_stringFunction · 0.80
test_local_variableFunction · 0.80
test_browser_apiFunction · 0.80

Calls 2

source_elementMethod · 0.80
set_bodyMethod · 0.80

Tested by 11

test_numFunction · 0.64
test_add_numsFunction · 0.64
test_sub_numsFunction · 0.64
test_assign_variableFunction · 0.64
test_reassign_variableFunction · 0.64
test_reassign_stringFunction · 0.64
test_local_variableFunction · 0.64
test_browser_apiFunction · 0.64