Very close to a basic REPL now.

This commit is contained in:
Simon Brooke 2026-04-16 22:28:35 +01:00
parent 83537391a6
commit 4efe9eab87
23 changed files with 188 additions and 84 deletions

View file

@ -48,7 +48,7 @@ void dump_string_cell( URL_FILE *output, wchar_t *prefix,
cell.payload.string.cdr.page,
cell.payload.string.cdr.offset, cell.count );
url_fwprintf( output, L"\t\t value: " );
print( output, pointer );
c_print( output, pointer );
url_fwprintf( output, L"\n" );
}
}
@ -71,7 +71,7 @@ void dump_object( URL_FILE *output, struct cons_pointer pointer ) {
cell.payload.cons.car.offset,
cell.payload.cons.cdr.page,
cell.payload.cons.cdr.offset, cell.count );
print( output, pointer );
c_print( output, pointer );
url_fputws( L"\n", output );
break;
case EXCEPTIONTV:
@ -97,18 +97,18 @@ void dump_object( URL_FILE *output, struct cons_pointer pointer ) {
break;
case LAMBDATV:
url_fwprintf( output, L"\t\t\u03bb cell;\n\t\t args: " );
print( output, cell.payload.lambda.args );
c_print( output, cell.payload.lambda.args );
url_fwprintf( output, L";\n\t\t\tbody: " );
print( output, cell.payload.lambda.body );
c_print( output, cell.payload.lambda.body );
url_fputws( L"\n", output );
break;
case NILTV:
break;
case NLAMBDATV:
url_fwprintf( output, L"\t\tn\u03bb cell; \n\t\targs: " );
print( output, cell.payload.lambda.args );
c_print( output, cell.payload.lambda.args );
url_fwprintf( output, L";\n\t\t\tbody: " );
print( output, cell.payload.lambda.body );
c_print( output, cell.payload.lambda.body );
url_fputws( L"\n", output );
break;
case RATIOTV:
@ -121,7 +121,7 @@ void dump_object( URL_FILE *output, struct cons_pointer pointer ) {
break;
case READTV:
url_fputws( L"\t\tInput stream; metadata: ", output );
print( output, cell.payload.stream.meta );
c_print( output, cell.payload.stream.meta );
url_fputws( L"\n", output );
break;
case REALTV:
@ -159,7 +159,7 @@ void dump_object( URL_FILE *output, struct cons_pointer pointer ) {
break;
case WRITETV:
url_fputws( L"\t\tOutput stream; metadata: ", output );
print( output, cell.payload.stream.meta );
c_print( output, cell.payload.stream.meta );
url_fputws( L"\n", output );
break;
}

View file

@ -140,13 +140,13 @@ void dump_map( URL_FILE *output, struct cons_pointer pointer ) {
&pointer_to_vso( pointer )->payload.hashmap;
url_fwprintf( output, L"Hashmap with %d buckets:\n", payload->n_buckets );
url_fwprintf( output, L"\tHash function: " );
print( output, payload->hash_fn );
c_print( output, payload->hash_fn );
url_fwprintf( output, L"\n\tWrite ACL: " );
print( output, payload->write_acl );
c_print( output, payload->write_acl );
url_fwprintf( output, L"\n\tBuckets:" );
for ( int i = 0; i < payload->n_buckets; i++ ) {
url_fwprintf( output, L"\n\t\t[%d]: ", i );
print( output, payload->buckets[i] );
c_print( output, payload->buckets[i] );
}
url_fwprintf( output, L"\n" );
}

View file

@ -291,7 +291,7 @@ void dump_frame_context_fragment( URL_FILE *output,
if ( frame != NULL ) {
url_fwprintf( output, L" <= " );
print( output, frame->arg[0] );
c_print( output, frame->arg[0] );
}
}
@ -332,12 +332,12 @@ void dump_frame( URL_FILE *output, struct cons_pointer frame_pointer ) {
url_fwprintf( output, L"\tArg %d:\t%4.4s\tcount: %10u\tvalue: ",
arg, cell.tag.bytes, cell.count );
print( output, frame->arg[arg] );
c_print( output, frame->arg[arg] );
url_fputws( L"\n", output );
}
if ( !nilp( frame->more ) ) {
url_fputws( L"More: \t", output );
print( output, frame->more );
c_print( output, frame->more );
url_fputws( L"\n", output );
}
}
@ -345,7 +345,7 @@ void dump_frame( URL_FILE *output, struct cons_pointer frame_pointer ) {
void dump_stack_trace( URL_FILE *output, struct cons_pointer pointer ) {
if ( exceptionp( pointer ) ) {
print( output, pointer2cell( pointer ).payload.exception.payload );
c_print( output, pointer2cell( pointer ).payload.exception.payload );
url_fputws( L"\n", output );
dump_stack_trace( output,
pointer2cell( pointer ).payload.exception.frame );