Skip to content

Instantly share code, notes, and snippets.

@wickchucked
Created April 15, 2013 18:15
Show Gist options
  • Save wickchucked/5390103 to your computer and use it in GitHub Desktop.
Save wickchucked/5390103 to your computer and use it in GitHub Desktop.
# Sanitize run command
@. # Sanitize result from duplicate labels (@ to '@')
@0200:(<mrpt>) .
@ rnm -1 .
@ lzr,-1 ,<cc>i4 chg <scc>i4 <cc> -1 chg <wcc>i4 <cc> +3 .
@ loc,-1,2,0205 'af' 1-<cc> '**** MULTI-LINE-TEXT - '<mrpt>(p)' ****' ,<mln>i7 .
@ inc,5 <mln> rdl,-1,<mln> 1-<cc> <code>s .
@ lcv,0000 '' <code> 'next' <b>i3 inc,5 <b> lcv,0000 '' <code> 'lines' <e>i3 dec <e> .
@ ldv <lns>i7=<code>(<b>-<e>) chg <endln>i7 <mln> + <lns> + 1 .
@0201:inc <mln> if <mln> eq <endln>,(0205) .
@ rdl,-1,<mln> 1-<cc> <rslt>s ldv,l <rslt> ldv <srslt>s<scc>=<rslt>(2-<scc>) .
@ lcv,lin-2 '' <rslt>(1-3) '@' <pos>i3 if <pos> ne 1,(0201) .
@ lcv,lin-2 '' <rslt>(1-3) '@'/TIC$'@'TIC$ ldv <wrslt>s<wcc>=<rslt>(1-3)<srslt> .
@ wrl,-1,<mln> 1-<cc> <wrslt>(1-<cc>) . This could chop of some if over <cc>
@ gto 0201 .
@.
@0205:return .
@.
@. # Remove tics ('@' to @)
@0210:() .
@ rnm -1 .
@ lzr,-1 ,<cc>i4,<mln>i7 chg <scc>i4 <cc> -3 chg <wcc>i4 <cc> .
@0211:inc <mln> rdl,-1,<mln>,0215 1-<cc> <rslt>s
@ ldv,l <rslt> ldv <srslt>s<scc>=<rslt>(4-<scc>) .
@ lcv,0211 '' <rslt>(1-3) TIC$@TIC$ <pos>i3 if <pos> eq 0,(0211) .
@ lcv,0211 '' <rslt>(1-3) TIC$'@'TIC$/'@' ldv <wrslt>s<wcc>=<rslt>(1-1)<srslt> .
@ wrl,-1,<mln> 1-<cc> <wrslt>(1-<cc>) . This could chop of some if over <cc>
@ gto 0211 .
@.
@0215:return .
@wickchucked
Copy link
Author

To sanitize

@     rsl,-8  call 0200 ('m-mkdwnDoc') . Convert @ to '@'
@     rnm -2 .

Back to original report for display

@     rsl,-2 .                                             
@     call 0210 () . Convert '@' back to @       

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment