TensorFile.extents: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_file.bend as TensorFile Lines 213-222 of stelliferous@0.0.2.0/tensor_file.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_file.bend&start_line=213&end_line=222 import Base # Extents up to the closing parenthesis: digits, commas and spaces. def extents(text: List<&2,U32>,+current: U32,digits: Bool,valid: Bool,shape: List<&2,U32>) -> Maybe<&2,List<&2,U32>>: match text: case Nil{}: None{} case Con{+byte,rest}: match byte: case 41: closed_shape(valid,pushed(digits,current,shape)) case 44: extents(rest,0,False{},valid,pushed(digits,current,shape)) case 32: extents(rest,current,digits,valid,shape) case _: extents(rest,(current * 10 + byte - 48 : U32),True{},valid && U32.is_le(48,byte) && U32.is_le(byte,57),shape) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=closed_shape https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_file.bend&name=pushed