Camen Design Forum

Kroc's Work Log


It's the function that never ends! (both in the time it's taking and the length of it). The `FileParse` function is 1'500 lines long and I've been working on massively re-architecting it for the last few weeks. Now before you get a hernia screaming 'bad programming', you should understand that this function is purposefully written with tons of GOTOs for speed, more speed and extra speed. When you have to parse millions of characters of text in VB6, function calls are are no longer viable.

* bluString now partially normalises whitespace when loading a file; this means that OZ80 only needs to consider ASCII Space, CarriageReturn and Tab and no other kind of whitespace during parsing, greatly simplifying and speeding up the character walking

* Completely re-worked the character walking to work on the basis of the first character of the word, words that end with white-space, words that end with line-break and multi-line words like comments. This helped eliminate some messy comment parsing and known-to-crash character look-aheads

* I noticed that the `HELP` statement would not work for `PROC` `PARAMS`/`RETURN` -- the Text is a list, and the next `PARAM` that follows would be treated as another byte for the text. To solve this I've added Documentation Text syntax (double back-tick) e.g.

% OZ80
PROC :doStuff
PARAMS HL ``Address to the data to process
{ }

This way documentation text can never clash with real text or other expressions. We also don't have to deal with how documentation text treats white-space compared to real text.


(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn