While doing other work in fossil, I've made a few enhancements to TH1.

------------------------------------------------------------------------
A) Removed expensive double scanning of whitespace in thEvalLocal during:

 * word-by-word parsing in the gobble phase of thEvalLocal.
 * # comment to EOL scanning

B) Added "\" end-of-line continuation support for both # comments and regular parsing. Line continuation supports both "\n" and "\r\n" line formats.

Thus making it possible to write expression like:

puts\
1;
#\
or whatever else comment
# and so on \
and on
puts \
2;

Which properly runs and outputs "12".

C) Minor fixes relating to makemake.tcl to add /FS build flag needed on windows to avoid parallel build race conditions while accessing .obj files. Explored tweaking the translate.c tool to support C99 // transformation for C89 back-compat to enable sources to use //.

D) Added C-layer Th_RenderEx to support script execution with security controls and output to a blob-output target capability. Added HTML script tag and variable reference compatibility to TH1 to allow variables and scripts to be conformingly embedded in HTML. Enabled TH1 variable references and privileged author execution of scripts throughout the wiki, ticket, etc system. Added additional hooks to support URL handling including GET/PUT requests using TH1.

E) Wrote wikieditor replacement. I.e., a new HTML/Markup (TH1+JS+CSS) customizable editor component with key-bindings that is mimetype aware and unifies the HTML+TH1, markdown, and fossil-wiki editing model. Import and export of wiki-files now can round-trip and transparently incorporate mimetype to file extension mappings.

F) Wrote some basic TH1 libraries and documentation to make learning and using TH1 within fossil a lower friction exercise.
------------------------------------------------------------------------
(A) Is only a performance fix, other perf-fixes exist as low-hanging fruit but that one was simple while refactoring for (B). The next obvious one is to remove the gobble phase entirely.

(B) Was more significant as we kept running into many cases using TH1 where we needed long lines and not having continuations made quoting forms a PITB <technical term="lol"/.>.

(D+E) Allows arbitrary server-side code to be written via the wiki or checkins. Any item containing scripts will have the scripts treated as no-ops if the author of the script doesn't have execution rights on the repo.

Cheers,

-- DSim


_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to