<commit_before>#+title: tok : a simple token-centric editor

* DONE An app with an editor.

#+begin_src pascal :tangle ".gen/tok.pas" :comments both :padline yes :noweb tangle

  {$mode delphi}
  program tok;
  uses uapp, mned;

  type TTokEd = class (uapp.TCustomApp)
    function init : boolean; override;
    procedure done; override;
  end;

  <<implementation>>

  begin
    uapp.run(TTokEd.Create);
  end.

#+end_src


* TODO init

#+name: implementation
#+begin_src pascal

  function TTokEd.init : boolean;
  begin
    result := true
  end;

#+end_src

* TODO done

#+name: implementation
#+begin_src pascal

  procedure TTokEd.done;
  begin
  end;

#+end_src<commit_msg>min/tok: show an mned.TEditor<commit_after>#+title: tok : a simple token-centric editor

* DONE An app with an editor.

#+begin_src pascal :tangle ".gen/tok.pas" :comments both :padline yes :noweb tangle

  {$mode delphi}
  program tok;
  uses uapp, mned, ukm;

  type TTokEd = class (uapp.TCustomApp)
    ed : mned.TEditor;
    function init : boolean; override;
    procedure step; override;
    procedure keys(km : ukm.TKeyMap); override;
    procedure done; override;
  end;

  <<implementation>>

  begin
    uapp.run(TTokEd.Create);
  end.

#+end_src


* init

#+name: implementation
#+begin_src pascal

  function TTokEd.init : boolean;
    begin
      ed := TEditor.Create(self);
      result := true
    end;

#+end_src

* keys

#+name: implementation
#+begin_src pascal
  
  procedure TTokEd.keys(km : ukm.TKeyMap);
    begin
      ed.AddDefaultKeys(km);
      km.cmd[ ^C ] := self.quit;
    end;
  
#+end_src


* step

#+name: implementation
#+begin_src pascal
  
  procedure TTokEd.step;
    begin
      ed.redraw;
    end;
  
#+end_src

* done

#+name: implementation
#+begin_src pascal

  procedure TTokEd.done;
    begin
    end;

#+end_src

* end
{'fraction_non_alphanumeric': 0.11406844106463879, 'fraction_numerical': 0.0, 'mean_word_length': 3.1486486486486487, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6210000', 'n_tokens_mistral': 700, 'n_tokens_neox': 677, 'n_words': 181}