Changeset a70441f in git for doc/doc2tex.pl
- Timestamp:
- Apr 27, 2000, 12:07:30 PM (23 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- e5f8ae07e0b41bb1b0e5aaaac2dad244e619d563
- Parents:
- eec9b2d2a332c04f20d743bdd4ccc107766fbc61
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/doc2tex.pl
reec9b2 ra70441f 1 1 #!/usr/local/bin/perl 2 # $Id: doc2tex.pl,v 1.2 4 2000-03-09 16:37:23 hannesExp $2 # $Id: doc2tex.pl,v 1.25 2000-04-27 10:07:20 obachman Exp $ 3 3 ################################################################### 4 4 # Computer Algebra System SINGULAR … … 7 7 # 8 8 #### 9 # @c example [error] [no_comp] 9 # @c example [error] [no_comp] [unix_only] 10 10 # -> the text till the next @c example is feed into Singular, 11 11 # the text is then substituted by … … 22 22 # unless 'error' is specified 23 23 # if no_comp is given, then computation is not run 24 # if unix_only is given, then computation is only run 25 # under unix 24 26 # 25 27 # … … 50 52 # 51 53 ################################################################### 54 55 use Config; 56 $Win32 = 1 if ($Config{osname} =~ /win/i); 52 57 53 58 # … … 66 71 $make = 0; 67 72 $make_opts = " --no-print-directory"; 73 68 74 69 75 # … … 217 223 218 224 ###################################################################### 219 # @c example [error] [no_comp] 225 # @c example [error] [no_comp] [unix_only] 220 226 # -> the text till the next @c example is fed into Singular, 221 227 # the text is then substituted by … … 232 238 # unless 'error' is specified 233 239 # If [no_comp] is given, actual computation is not run 240 # if [unix_only] is given, then computation is only run 241 # under unix 242 234 243 sub HandleExample 235 244 { 236 my($inc_file, $ex_file, $lline, $thisexample, $error_ok, $cache, $no_comp); 245 my($inc_file, $ex_file, $lline, $thisexample, $error_ok, $cache, $no_comp, 246 $unix_only); 237 247 238 248 $lline = $line; … … 262 272 $error_ok = 1 if /error/; 263 273 $no_comp = 1 if /no_comp/; 264 265 # print content in example file till next @c example 274 $unix_only = 1 if /unix_only/ && $Win32; 275 276 # print content in example file till next @c example 277 print TEX "// only supported on Unix platforms\n" 278 if $unix_only; 279 266 280 while (<DOC>) 267 281 { … … 269 283 last if (/^\@c\s*example\s*$/); 270 284 # s/^\s*//; # remove preceeding white spaces 271 if ($no_ex || $no_comp )285 if ($no_ex || $no_comp || $unix_only) 272 286 { 273 287 &protect_texi; … … 289 303 290 304 # done, if no examples 291 return if ($no_ex || $no_comp );305 return if ($no_ex || $no_comp || $unix_only); 292 306 293 307 # check whether it can be reused … … 321 335 print EX "$thisexample"; 322 336 close(EX); 337 338 unless ($Singular_OK) 339 { 340 if (system("echo '\$' | $Singular $Singular_opts > $res_file")) 341 { 342 $Singular .= '.exe' if ($Win32 && $Singular !~ /\.exe$/); 343 Error("CanŽt run '$Singular $Singular_opts': $@") 344 if (system("echo '\$' | $Singular $Singular_opts > $res_file")); 345 } 346 $Singular_OK = 1 347 } 323 348 324 349 &System("echo '\$' | $Singular $Singular_opts $ex_file > $res_file"); … … 492 517 $proc = $1 if (/^:(.*?) /); 493 518 $n_fun = 1 if ($no_fun || /no_fun/); 494 $n_ex = 1 if ($no_ex || /no_ex/ );519 $n_ex = 1 if ($no_ex || /no_ex/ || (/unix_only/ && $Win32)); 495 520 $section = $1 if /(\w*)section/; 496 521
Note: See TracChangeset
for help on using the changeset viewer.