% % check the date/time of jsx file compared to task tree mod date/time % % insure the root name is simplified to non-# separated % *jsphsimp % % inspect the file date-time compared to the tree % *jsphfdif _JS.Filed %%% true or { % % the jsx file is newer than the tree, load the jsx file % ".jsx" *jspmfile dup exists { % % the jsx file exists % "Save" *persists % % mark all non-root nodes to be default missing % Tree.Up { !\ "Body" \_ length) { "Missing" _\ Tree.!Mark } if } for % % get the jsx file % read % % append insurance final marker, last section will be processed % &"/*:.:*/ " % % save the source and source length % length !srclen dup !src % % create a regex match tree that identifies the jsx code sections % "/\*:\S*:\*/" rex &; mats dup "_mats" text!bin % % process the matches as jsx code to add to the tree % 0 !match empty !namer "Matches" second <> pop countup { second <> pop !token pop !len !start "mat " &_token &" " &_start logs % % isolate the code section name, removing the bracketing text % _token -3 right -3 left % % the content before the token line is given to the % prior node established by the prior token % the assignment is not done when it is the zero (first) index % _match dupnzis { % % stack: token matches % _start second sub _src tuck mid dup ^_namer logs % % stack: token match-body % % add this header as hierarchy in the tree % the dot-separated parts of the function hierarchy % are created in the tree if needed % root\ _namer "." "\" replall true _\ @^Seek "pullseek " &2 &" " &3 &" " &4 &" " &5 logs pop2nd pop3rd { % % did not exist % !\ "New" _\ Tree.!Mark } { % % did exist % !\ } ifelse % % stack: token match-body % _namer "ftn" \! % now set to node for jsx code body insertion % trim &; "Body" \_ isnull { % % no prior body % pop } { second exact$ { % % same body text % "Default" _\ Tree.!Mark } { % % body text has changed % "Changed" _\ Tree.!Mark } ifelse } ifelse "Body" \! } if % % the new token will become the anchor for the next content assign % !namer % % move the match pointer within the text % _start _len add + !match } for pop % % mark the modification of the tree using the date/time of the jsx file % ".jsx" *jspmfile stamp "Jsxtime" log)( "Mod" 0 Tree.!ValueOf *expander % % mark the tree as changed % nod@ } { % % tree is later or same date/time as the jsx file % pop } ifelse } if