Rework parser and API #9

Closed
opened 2024-10-24 12:09:37 +02:00 by MarieEckert · 0 comments
MarieEckert commented 2024-10-24 12:09:37 +02:00 (Migrated from github.com)

While functional the current state of the parser and the API make it quite annoying to work with it because non-structural switches (such as color, style and head) are left as text within the section tree.

Adjusted/new data structures should look something like this:

type
  TTokenType = (ttSWITCH (* , ... *));
  
  TToken = record
    token_type : TTokenType;
    data       : String;
  end;

  TSection = record
    (* metadata *)
    is_root         : Boolean; (* Is it the root section? *)
    owning_document : PSADocument; (* Pointer to the owning document *)
    name            : String;

    (* contents *)
    children        : array of TSection;
    contents        : array of TToken;
  end;
While functional the current state of the parser and the API make it quite annoying to work with it because non-structural switches (such as color, style and head) are left as text within the section tree. Adjusted/new data structures should look something like this: ```pascal type TTokenType = (ttSWITCH (* , ... *)); TToken = record token_type : TTokenType; data : String; end; TSection = record (* metadata *) is_root : Boolean; (* Is it the root section? *) owning_document : PSADocument; (* Pointer to the owning document *) name : String; (* contents *) children : array of TSection; contents : array of TToken; end; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
marie/sad#9
No description provided.