MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/2/cwd/proc/self/root/proc/2/root/usr/lib/python2.4/Tools/scripts/texcheck.pyc
mò
‚=5Dc@sdZdkZdkZdkZdklZlZlZdkZdZ	d„Z
gd„Zdd„Z
edjoeie
ƒƒndS(sá TeXcheck.py -- rough syntax checking on Python style LaTeX documents.

   Written by Raymond D. Hettinger <python at rcn.com>
   Copyright (c) 2003 Python Software Foundation.  All rights reserved.

Designed to catch common markup errors including:
* Unbalanced or mismatched parenthesis, brackets, and braces.
* Unbalanced or mismatched \begin and \end blocks.
* Misspelled or invalid LaTeX commands.
* Use of forward slashes instead of backslashes for commands.
* Table line size mismatches.

Sample command line usage:
    python texcheck.py -k chapterheading -m lib/librandomtex *.tex

Options:
    -m          Munge parenthesis and brackets. [0,n) would normally mismatch.
    -k keyword: Keyword is a valid LaTeX command. Do not include the backslash.
    -d:         Delimiter check only (useful for non-LaTeX files).
    -h:         Help
    -s lineno:  Start at lineno (useful for skipping complex sections).
    -v:         Verbose.  Trace the matching of //begin and //end blocks.
N(sizipscountsislicesà
    \section \module \declaremodule \modulesynopsis \moduleauthor
    \sectionauthor \versionadded \code \class \method \begin
    \optional \var \ref \end \subsection \lineiii \hline \label
    \indexii \textrm \ldots \keyword \stindex \index \item \note
    \withsubitem \ttindex \footnote \citetitle \samp \opindex
    \noindent \exception \strong \dfn \ctype \obindex \character
    \indexiii \function \bifuncindex \refmodule \refbimodindex
    \subsubsection \nodename \member \chapter \emph \ASCII \UNIX
    \regexp \program \production \token \productioncont \term
    \grammartoken \lineii \seemodule \file \EOF \documentclass
    \usepackage \title \input \maketitle \ifhtml \fi \url \Cpp
    \tableofcontents \kbd \programopt \envvar \refstmodindex
    \cfunction \constant \NULL \moreargs \cfuncline \cdata
    \textasciicircum \n \ABC \setindexsubitem \versionchanged
    \deprecated \seetext \newcommand \POSIX \pep \warning \rfc
    \verbatiminput \methodline \textgreater \seetitle \lineiv
    \funclineni \ulink \manpage \funcline \dataline \unspecified
    \textbackslash \mimetype \mailheader \seepep \textunderscore
    \longprogramopt \infinity \plusminus \shortversion \version
    \refmodindex \seerfc \makeindex \makemodindex \renewcommand
    \indexname \appendix \protect \indexiv \mbox \textasciitilde
    \platform \seeurl \leftmargin \labelwidth \localmoduletable
    \LaTeX \copyright \memberline \backslash \pi \centerline
    \caption \vspace \textwidth \menuselection \textless
    \makevar \csimplemacro \menuselection \bfcode \sub \release
    \email \kwindex \refexmodindex \filenq \e \menuselection
    \exindex \linev \newsgroup \verbatim \setshortversion
    \author \authoraddress \paragraph \subparagraph \cmemberline
cCs|y|iƒ\}}Wn&tj
od||fGHdSnX||i||gƒjodSnd||||fGHdS(sCVerify that closing delimiter matches most recent opening delimitersU
Delimiter mismatch.  On line %d, encountered closing '%s' without corresponding openNsJ
Opener '%s' on line %d was not closed before encountering '%s' on line %d(	topenerstpopto_linenoto_symbolt
IndexErrortc_linenotc_symboltpairmaptget(RRRRRR((t,/usr/lib/python2.4/Tools/scripts/texcheck.pyt
matchclose>s	c#Csƒtidƒ}tidƒ}ttiƒƒ}!x|D]}|!i
d|ƒq7Wd|johdd<dd<}nhdd	<dd
<}tdƒ}tidƒ}tidƒ}	tid
ƒ}tidƒ}g}
g}"tidƒ}tidƒ}tidƒ}d}d}t|iddƒƒ}
d}xétt|
ƒt||
dd/ƒƒD]Â\}}|i#ƒ}x	|i$|ƒD]ø\}}}d|jo|GdG|G|G|Gn|djo$d|jo|
i(||fƒnz||jo|
i(||fƒnV|djo$d|jot)|||
|ƒn%||jot)|||
|ƒnd|jo
dG|
GHqŒqŒWx||	i$|ƒD]k\}}|djo|"i(|ƒn|djo4y|"i,ƒWqt-j
od|fGHqXq˜q˜Wd|joqdnx\|i$|ƒD]K}d |jp
d!|joq+nd||!jod"||fGHq+q+Wx)|i$|ƒD]}d#|||fGHqŠW|i.d$ƒ}|d%jo@|i.d|ƒ}|i.d|ƒ}|!i
||d|!ƒnx7|i$|ƒD]&}||!jod&||fGHqqW|i2|ƒ} | o| i4dƒ}|}n|i2|ƒ} | o8| i4dƒ|jo"d'| i4dƒ|||fGHn|i2|ƒo
d}nd(|jp
d)|jod*|fGHnx&|i$|ƒD]}d+||fGHq
WqdW|}x#|
D]\}}d,||fGHq7Wx|"D]}d-|fGHq]Wd.|fGHdS(0s¼Check the LaTeX formatting in a sequence of lines.

    Opts is a mapping of options to option values if any:
        -m          munge parenthesis and brackets
        -d          delimiters only checking
        -v          verbose trace of delimiter matching
        -s lineno:  linenumber to start scan (default is 1).

    Morecmds is a sequence of LaTeX commands (without backslashes) that
    are to be considered valid in the scan.
    s\\[A-Za-z]+s
\/([A-Za-z]+)s\s-mt]s[(t)s([t[t(s&\\(begin|end){([_a-zA-Z]+)}|([()\[\]])s({)|(})s(\b[A-za-z]+\b) \b\1\bs<\\(ABC|ASCII|C|Cpp|EOF|infinity|NULL|plusminus|POSIX|UNIX)\ss\\begin{(?:long)?table([iv]+)}s\\line([iv]+){s\\end{(?:long)?table([iv]+)}tis-st1is-vt|tbegins-dtends   --> t{t}s Warning, unmatched } on line %s.t822s.htmls4Warning, forward slash used on line %d with cmd: /%ss2Warning, \%s should be written as \%s{} on line %ds\newcommandiÿÿÿÿs(Warning, unknown tex cmd on line %d: \%ss>Warning, \line%s on line %d does not match \table%s on line %dse.g.si.e.s2Style warning, avoid use of i.e or e.g. on line %ds&Doubled word warning.  "%s" on line %ds(Unmatched open delimiter '%s' on line %dsUnmatched { on line %dsDone checking %d lines.N(8tretcompilettexcmdtfalsetexcmdtsettcmdstrtsplitt	validcmdstmorecmdstcmdtaddtoptsRt	openpunctt
delimiterstbracestdoubledwordst
spacingmarkupRt
bracestackt
tablestartt	tablelinettableendt
tablelevelttablestartlinetintRt	startlinetlinenotiziptcounttislicetsourcetNonetlinetrstriptfindalltbegendtnametpuncttappendR
topentcloseRRtfindtnctstartRtsearchtmtgrouptdwtlastlinetsymbol(#R4R"RR)R*RER>R+R=R%R/R&RRRR0RFR-RARR$RGRR@R;R6R'R:R,R#R9R RCRR(((R	tcheckitIsº
&









"
c
Cs«|djotid}nti|dƒ\}}t|ƒ}d|jp
|gjo
t	GHdSnt
|ƒdjo
dGHdSnxRt|ƒD]D\}}d|jp
d|joti|ƒ|||d+q–q–Wg}
|D]$\}	}|	djo|
|qéqé~
}g}x‚|D]z}d	d
GHdG|GHyt|ƒ}Wn$tj
od|dGHd
SnXz|it|||ƒƒWd|iƒXq#Wt|ƒS(Nisk:mdhs:vs-his#Please specify a file to be checkedt*t?s-kt=itCheckingsCannot open file %s.i(targsR5tsystargvtgetopttoptitemstarglisttdictR"t__doc__tlent	enumeratetitfilespectglobt_[1]tktvRterrtfilenameR=tftIOErrorR<RHR>tmax(
RMRRRR^RQRXR]R_RWR[RZR\R"((R	tmainÃs<

"8		
	t__main__(RTRRNRPt	itertoolsR1R2R3RYRR
RHR5Rbt__name__texit(R2RHR1RRNRR3RPRbRYR
((R	RJs					z$