Subversion Repositories wimsdev

Rev

Rev 17961 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!read language lang/names.phtml

!bound sw within $swlist default $
src=!trim $src
!if $sw iswordof jsxscript graphviz draw canvasdraw jsme tikz float_calc
  !default src=!record 0 of example.$sw
!endif
!if $sw iswordof graphvizsvg
  !default src=!record 0 of example.graphviz
!endif
!if $sw=$empty or $src=$empty or $cmd!=reply
  compute=no
  !exit
!endif

sw1=!positionof item $sw in $swlist
SW=!item $sw1 of $swname

compute=yes

!reset wims_exec_error
nonprintable=

src=!translate internal $nonprintable to \
        $                                           $ in $src
src1=!replace internal $ by $$$$ in $src

!if $sw iswordof tikz draw
  !if $sw=draw
    ins_format=gif
  !else
    ins_format=tex
  !endif
  tmp=!line 1 of $src1
  !if new iswordof $tmp or size iswordof $tmp
    insdraw_size=!word 2 to -1 of $tmp
    src_=!line 2 to -1 of $src
  !endif
  !insdraw $src_
  !if $sw=draw
    swout=$ins_url
  !else
    swout=!nonempty lines $ins_tikz
  !endif
  !goto execout
!endif
!if $sw=canvasdraw
  tmp=!line 1 of $src1
  !if new iswordof $tmp
    tmp=!replace internal new by size in $tmp
    src1=!replace line number 1 by $tmp in $src1
  !endif
  swout=!exec canvasdraw $src1
  !goto execout
!endif
!if $sw=perl
  swout=!perl $src1
  !goto execout
!endif
!if $sw=sh
  swout=!sh $src1
  !goto execout
!endif
!if $sw=jsxgraph
  swout=$src1
  !goto execout
!endif
!if $sw iswordof reactiondraw
    swout=$src1
    cnt=!itemcnt $swout
    !if $cnt=1
      swout=$swout,
    !endif
  !goto execout
!endif
!if $sw iswordof jmol jsme
  swout=$src1
  !goto execout
!endif
!if $sw=insmath
  wims_backslash_insmath=yes
  swout=\($src1\)
  !goto execout
!endif
!if $sw=graphvizsvg
  graphviz_output=svg
  swout1=!exec graphviz $src1
  swoutcnt=!linecnt $swout1
  !for l=7 to $swoutcnt
    gs=!line $l of $swout1
    !if __plain isin __$gs
      !break
    !endif
    swout=!append line $gs to $swout
  !next
  !goto execout
!endif

swout=!exec $sw $src1
!if $sw iswordof pari
  swout=!replace internal $ $ $ by $\
$ in $swout
!endif
!if $sw iswordof maxima
  swout=!replace internal $ $ $ $ $ $ $ $   by $\
$ in $swout
!endif
!if $sw=povray
  swout=!line -1 of $swout
!endif
!if $sw=m2
  swout=!translate # to $\
$ in $swout
!endif
:execout
msg=!trim $wims_exec_error
msg=!line 2 to -1 of $msg
!reset wims_exec_error

src2=!singlespace $src
src2=!char 1 to 20 of $src2
wims_module_log=$sw $src2