1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
Commit Graph

13 Commits

Author SHA1 Message Date
Ben Dudson
9cb9566897 Tidying, minimising differences between steps
Merging fixes in stepA into earlier steps, and
removing differences in comments and spacing
2018-01-04 16:07:01 +00:00
Ben Dudson
2f61f4a8d3 Tidying up steps 0-3 (in progress)
Trying to remove common code, and minimise differences
between steps.
2018-01-03 23:50:34 +00:00
Ben Dudson
0a96ee8abe All tests pass
Some modifications needed to earlier steps
so they compile with the new core functions.

Need to disable double free error checks
in types, because step2 fails otherwise.
2017-12-27 17:32:01 +00:00
Ben Dudson
f0662456ba Move types and system calls into separate files
* Memory management, Cons, Arrays and String types in types.asm
* Functions containing syscall in system.asm

* Added more useful error message in reader, on unexpected end of input
2017-10-22 00:24:53 +01:00
Ben Dudson
1eb4f83354 String printing and negative numbers
* Prints strings, escaping " and \n
* Handles negative integers, reading and printing.
  Difference between "- 10"  (symbol, number) and "-10" (number)

All essential and deferrable tests pass
2017-10-22 00:05:33 +01:00
Ben Dudson
955b354b00 Handles symbols, quoting and unquoting
Test suite passes required and deferrable tests except:

1. () is apparently different from nil, so empty list needs to be
   handled differently

2. String printing currently just prints the string without
   quotes or escapes.
2017-10-21 08:21:56 +01:00
Ben Dudson
f2abb9c15f Integer list reading and writing working
* Integer tokenizer was not putting the last non-integer
  character back, so end of tokens was returned rather than ')'

* Some typos, jne <-> je
2017-10-20 07:27:03 +01:00
Ben Dudson
e69ec59895 pr_str prints simple lists, reader improving
Can now print (int int) from a list of two Cons objects.

Reader code should now read lists, but not yet working.
2017-10-19 23:01:33 +01:00
Ben Dudson
684d814dd8 String concatenation working
Progress on printer, not yet working.

string_append_string now appends one string to the end
of another, handling long strings with multiple Array blocks.
2017-10-18 00:14:31 +01:00
Ben Dudson
d5e01edc36 Reader and printer read/write integers
Some progress: Integers read, passed as Cons object
through to pr_str, then as Array (string) to print_string.
Memory management (reference counting works so far...)
2017-10-15 00:26:09 +01:00
Ben Dudson
365bc24cff Work on tokenizer
Not complete yet, but should recognise special characters
and strings (mostly). String code not complete yet, since
it won't handle long strings correctly (no chaining of Arrays).
2017-10-12 23:59:13 +01:00
Ben Dudson
2d3ea9330e Clarifying types, tidying object release code
Changed how types of containers and content are marked,
and how these map onto MAL types.

Simplified object release code, since data type
is always now stored with the data.
2017-10-11 23:29:29 +01:00
Ben Dudson
e21edd83c3 Adding memory allocation, started reader
Simple fixed-size memory manager, which uses reference counting
and a list of free blocks. Not properly tested yet, particularly
the Cons version (linked list) which is more complicated than
the Array type.
2017-10-10 00:22:10 +01:00