Skip to content

Hi, I just make it works with recent version of pyparsing again #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Supression des fichiers autogénérés. gestion de sagestr.
  • Loading branch information
vincek59 committed Apr 5, 2021
commit c7fb3e11eec6618dc336b51965aca5dd4006e5f8
80 changes: 0 additions & 80 deletions makestatic.py

This file was deleted.

262 changes: 0 additions & 262 deletions sagetexparse.py

This file was deleted.

10 changes: 6 additions & 4 deletions scripts.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ from pyparsing import *
% \begin{macrocode}
def skipToMatching(opener, closer):
nest = nestedExpr(opener, closer)
nest.setParseAction(lambda l, s, t: l[s:getTokensEndLoc()])
return nest
return originalTextFor(nest)

curlybrackets = skipToMatching('{', '}')
squarebrackets = skipToMatching('[', ']')
% \end{macrocode}
% Next, parser for |\sage|, |\sageplot|, and pause/unpause calls:
% \begin{macrocode}
sagemacroparser = r'\sage' + curlybrackets('code')
sagestrmacroparser = r'\sagestr' + curlybrackets('code')
sageplotparser = (r'\sageplot'
+ Optional(squarebrackets)('opts')
+ Optional(squarebrackets)('format')
Expand Down Expand Up @@ -365,8 +365,10 @@ class DeSageTex():
% Parse |\sage| macros. We just need to pull in the result from the
% |.sout| file and increment the counter---that's what |self.sage| does.
% \begin{macrocode}
strmacro = sagestrmacroparser
smacro = sagemacroparser
smacro.setParseAction(self.sage)
strmacro.setParseAction(self.sage)
% \end{macrocode}
% Parse the |\usepackage{sagetex}| line. Right now we don't support
% comma-separated lists of packages.
Expand Down Expand Up @@ -410,7 +412,7 @@ class DeSageTex():
% looks for any one of the above bits, while ignoring anything that
% should be ignored.
% \begin{macrocode}
doit = smacro | senv | ssilent | usepackage | splot | stexindent
doit = smacro | senv | ssilent | usepackage | splot | stexindent |strmacro
doit.ignore('%' + restOfLine)
doit.ignore(r'\begin{verbatim}' + SkipTo(r'\end{verbatim}'))
doit.ignore(r'\begin{comment}' + SkipTo(r'\end{comment}'))
Expand Down Expand Up @@ -496,7 +498,7 @@ class SageCodeExtractor():

def plotout(self, s, l, t):
self.result += '# \\sageplot{} from line %s:\n' % lineno(l, s)
if t.format is not '':
if t.format != '':
self.result += '# format: %s' % t.format[0][1:-1] + '\n'
self.result += t.code[1:-1] + '\n\n'

Expand Down