oh wait if cohost allows arbitrary html does that mean i can actually use my terminal emulator's "Copy as HTML" feature?
1196 β fn build_closure(&mut self, code: &CodeObject) -> bool {
1197 β if code.freevars.is_empty() {
1198 β return false;
1199 β }
1200 β for var in &*code.freevars {
1201 β let table = self.symbol_table_stack.last().unwrap();
1202 β let symbol = table.lookup(var).unwrap_or_else(|| {
1203 β panic!(
1204 β "couldn't look up var {} in {} in {}",
1205 β var, code.obj_name, self.source_path
1206 β )
1207 β });
1208 β let parent_code = self.code_stack.last().unwrap();
1209 β let vars = match symbol.scope {
1210 β SymbolScope::Free => &parent_code.freevar_cache,
1211 β SymbolScope::Cell => &parent_code.cellvar_cache,
1212 β _ if symbol.is_free_class => &parent_code.freevar_cache,
1213 β x => unreachable!(
1214 β "var {} in a {:?} should be free or cell but it's {:?}",
1215 β var, table.typ, x
1216 β ),
1217 β };
1218 β let mut idx = vars.get_index_of(var).unwrap();
1219 β if let SymbolScope::Free = symbol.scope {
1220 β idx += parent_code.cellvar_cache.len();
1221 β }
1222 β self.emit(Instruction::LoadClosure(idx as u32))
1223 β }
1224 β self.emit(Instruction::BuildTuple {
1225 β size: code.freevars.len() as u32,
1226 β unpack: false,
1227 β });
1228 β true
1229 β }
awww.
For reference, that was a bunch of <font color="#abcdef"> tags inside a <pre> tag, but cohost stripped them just leaving the text. that should be allowed I feel.... but I can do some processing to it to turn them into <span style=""> probably
yes.... YES...
rustpython on ξ main [$] is π¦ v0.1.2 via π v3.10.8 via π¦ v1.65.0 β― clippaste | sd '<font color="' '<span style="color:' | sd '</font' '</span' | clipcopy rustpython on ξ main [$] is π¦ v0.1.2 via π v3.10.8 via π¦ v1.65.0 β―
was gonna do something with actual html dom manipulation but that's too haurd... and this should work on well-formed html anyway so