parse_two_pass_tape
def parse_two_pass_tape[force_scalar: Bool = False](var input: String) -> Document End-to-end stage 1 + stage 2 parse that emits a Document.
- Parameters
force_scalar: When False (default), use the SIMD stage 1 implementation (stage1.parse_structural_simd); on the benchmark corpora SIMD is ~1.2x faster than the scalar walker. When True, use the scalar oracle -- useful for differential testing and for inputs small enough that the SIMD chunk loop never runs (n < 32). Both produce identical output (enforced bytests/test_stage1_equivalence.mojo); this is purely a performance switch.
- Args
input: JSON input. The returnedDocumentowns this string, so its bytes can back zero-copy string slices on the tape.