MCPcopy Index your code
hub / github.com/RustPython/RustPython / make_token_tuple

Function make_token_tuple

crates/stdlib/src/_tokenize.rs:588–611  ·  view source on GitHub ↗
(
        vm: &VirtualMachine,
        token_type: u8,
        string: &str,
        start_line: usize,
        start_col: isize,
        end_line: usize,
        end_col: isize,
        line: &str,
 

Source from the content-addressed store, hash-verified

586
587 #[allow(clippy::too_many_arguments)]
588 fn make_token_tuple(
589 vm: &VirtualMachine,
590 token_type: u8,
591 string: &str,
592 start_line: usize,
593 start_col: isize,
594 end_line: usize,
595 end_col: isize,
596 line: &str,
597 ) -> PyObjectRef {
598 vm.ctx
599 .new_tuple(vec![
600 token_type.to_pyobject(vm),
601 vm.ctx.new_str(string).into(),
602 vm.ctx
603 .new_tuple(vec![start_line.to_pyobject(vm), start_col.to_pyobject(vm)])
604 .into(),
605 vm.ctx
606 .new_tuple(vec![end_line.to_pyobject(vm), end_col.to_pyobject(vm)])
607 .into(),
608 vm.ctx.new_str(line).into(),
609 ])
610 .into()
611 }
612
613 #[derive(FromArgs)]
614 pub struct PyTokenizerIterArgs {

Callers 1

emit_next_tokenFunction · 0.85

Calls 1

new_tupleMethod · 0.45

Tested by

no test coverage detected