diff --git a/moo.js b/moo.js
index 5b7fdef..1adcc2a 100644
--- a/moo.js
+++ b/moo.js
@@ -60,28 +60,28 @@
return Array(length - s.length + 1).join(" ") + s
}
- function lastNLines(string, numLines) {
- var position = string.length
- var lineBreaks = 0;
+ function lastNLines(string, firstLine, lastLine) {
+ var position = 0;
+ var lineBreaks = 1;
+ var startPosition = 0;
while (true) {
- var idx = string.lastIndexOf("\n", position - 1)
+ var idx = string.indexOf("\n", position);
if (idx === -1) {
break;
} else {
lineBreaks++
}
- position = idx
- if (lineBreaks === numLines) {
+ position = idx + 1;
+ if (lineBreaks === firstLine) {
+ startPosition = position;
+ }
+ if (lineBreaks === lastLine) {
break;
}
if (position === 0) {
break;
}
}
- var startPosition =
- lineBreaks < numLines ?
- 0 :
- position + 1
return string.substring(startPosition).split("\n")
}
@@ -408,6 +408,7 @@
this.buffer = data || ''
this.index = 0
this.line = info ? info.line : 1
+ this.bufferFirstLine = this.line
this.col = info ? info.col : 1
this.queuedToken = info ? info.queuedToken : null
this.queuedText = info ? info.queuedText: "";
@@ -600,14 +601,16 @@
}
var numLinesAround = 2
- var firstDisplayedLine = Math.max(token.line - numLinesAround, 1)
+ var firstDisplayedLine = this.bufferFirstLine + Math.max(token.line - this.bufferFirstLine - numLinesAround, 0)
var lastDisplayedLine = token.line + numLinesAround
var lastLineDigits = String(lastDisplayedLine).length
+ var firstBufferedLine = firstDisplayedLine - this.bufferFirstLine + 1
+ var lastBufferedLine = lastDisplayedLine - this.bufferFirstLine + 1
var displayedLines = lastNLines(
this.buffer,
- (this.line - token.line) + numLinesAround + 1
- )
- .slice(0, 5)
+ firstBufferedLine,
+ lastBufferedLine)
+ .slice(0, lastDisplayedLine - firstDisplayedLine + 1)
var errorLines = []
errorLines.push(message + " at line " + token.line + " col " + token.col + ":")
errorLines.push("")
diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap
index e063c77..7bb82ee 100644
--- a/test/__snapshots__/test.js.snap
+++ b/test/__snapshots__/test.js.snap
@@ -1,11368 +1,13084 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`example: python kurt python 1`] = `
-Array [
- "COMMENT \\"# Copyright (C) 2012 Tim Radvan\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# This file is part of Kurt.\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# Kurt is free software: you can redistribute it and/or modify it under the\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# terms of the GNU Lesser General Public License as published by the Free\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# Software Foundation, either version 3 of the License, or (at your option) any\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# later version.\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# Kurt is distributed in the hope that it will be useful, but WITHOUT ANY\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# details.\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# You should have received a copy of the GNU Lesser General Public License\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# along with Kurt. If not, see .\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "STRING \\"\\\\nA Python module for reading and writing Scratch project files.\\\\n\\\\nScratch is created by the Lifelong Kindergarten Group at the MIT Media Lab.\\\\nSee their website: http://scratch.mit.edu/\\\\n\\\\n\\\\nClasses\\\\n-------\\\\n\\\\nThe main interface:\\\\n\\\\n* :class:\`Project\`\\\\n\\\\nThe following :class:\`Actors \` may be found on the project stage:\\\\n\\\\n* :class:\`Stage\`\\\\n* :class:\`Sprite\`\\\\n* :class:\`Watcher\`\\\\n\\\\nThe two :class:\`Scriptables \` (:class:\`Stage\` and :class:\`Sprite\`)\\\\nhave instances of the following contained in their attributes:\\\\n\\\\n* :class:\`Variable\`\\\\n* :class:\`List\`\\\\n\\\\nScripts use the following classes:\\\\n\\\\n* :class:\`Block\`\\\\n* :class:\`Script\`\\\\n* :class:\`Comment\`\\\\n* :class:\`BlockType\`\\\\n\\\\nMedia files use the following classes:\\\\n\\\\n* :class:\`Costume\`\\\\n* :class:\`Image\`\\\\n* :class:\`Sound\`\\\\n* :class:\`Waveform\`\\\\n\\\\nFile Formats\\\\n------------\\\\n\\\\nSupported file formats:\\\\n\\\\n =============== =========== =========\\\\n Format Name Description Extension\\\\n =============== =========== =========\\\\n \`\`\\\\\\"scratch14\\\\\\"\`\` Scratch 1.4 \`\`.sb\`\`\\\\n \`\`\\\\\\"scratch20\\\\\\"\`\` Scratch 2.0 \`\`.sb2\`\`\\\\n =============== =========== =========\\\\n\\\\nPass \\\\\\"Format name\\\\\\" as the argument to :attr:\`Project.convert\`.\\\\n\\\\nKurt provides a superset of the information in each individual format, but will\\\\nonly convert features between a subset of formats.\\\\n\\\\n----\\\\n\\\\n\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"__version__\\"",
- "OP \\"=\\"",
- "STRING \\"2.0.7\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"from\\"",
- "NAME \\"collections\\"",
- "NAME \\"import\\"",
- "NAME \\"OrderedDict\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"import\\"",
- "NAME \\"re\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"import\\"",
- "NAME \\"os\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"import\\"",
- "NAME \\"random\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"try\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"from\\"",
- "NAME \\"cStringIO\\"",
- "NAME \\"import\\"",
- "NAME \\"StringIO\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"except\\"",
- "NAME \\"ImportError\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"from\\"",
- "NAME \\"StringIO\\"",
- "NAME \\"import\\"",
- "NAME \\"StringIO\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"import\\"",
- "NAME \\"PIL\\"",
- "OP \\".\\"",
- "NAME \\"Image\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"import\\"",
- "NAME \\"wave\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#-- Utils --#\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"_clean_filename\\"",
- "OP \\"(\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Strip non-alphanumeric characters to makes name safe to be used as\\\\n filename.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"return\\"",
- "NAME \\"re\\"",
- "OP \\".\\"",
- "NAME \\"sub\\"",
- "OP \\"(\\"",
- "STRING \\"[^\\\\\\\\\\\\\\\\w .]\\"",
- "OP \\",\\"",
- "STRING \\"\\"",
- "OP \\",\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#-- Project: main class --#\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"Project\\"",
- "OP \\"(\\"",
- "NAME \\"object\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"The main kurt class. Stores the contents of a project file.\\\\n\\\\n Contents include global variables and lists, the :attr:\`stage\` and\\\\n :attr:\`sprites\`, each with their own :attr:\`scripts\`, :attr:\`costumes\`,\\\\n :attr:\`sounds\`, :attr:\`variables\` and :attr:\`lists\`.\\\\n\\\\n A Project can be loaded from or saved to disk in a format which can be read\\\\n by a Scratch program or one of its derivatives.\\\\n\\\\n Loading a project::\\\\n\\\\n p = kurt.Project.load(\\\\\\"tests/game.sb\\\\\\")\\\\n\\\\n Getting all the scripts::\\\\n\\\\n for scriptable in p.sprites + [p.stage]:\\\\n for script in scriptable.scripts:\\\\n print script\\\\n\\\\n Creating a new project::\\\\n\\\\n p = kurt.Project()\\\\n\\\\n Converting between formats::\\\\n\\\\n p = kurt.Project.load(\\\\\\"tests/game.sb\\\\\\")\\\\n p.convert(\\\\\\"scratch20\\\\\\")\\\\n # []\\\\n p.save()\\\\n # 'tests/game.sb2'\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"__init__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\"=\\"",
- "NAME \\"u\\"",
- "STRING \\"\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The name of the project.\\\\n\\\\n May be displayed to the user. Doesn't have to match the filename in\\\\n :attr:\`path\`. May not be saved for some formats.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"None\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The path to the project file.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\"=\\"",
- "NAME \\"None\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The file format plugin used to load this project.\\\\n\\\\n Get the current format using the :attr:\`format\` property. Use\\\\n :attr:\`convert()\` to change between formats.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\"=\\"",
- "NAME \\"Stage\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The :class:\`Stage\`.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\"=\\"",
- "OP \\"[\\"",
- "OP \\"]\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"List of :class:\`Sprites \`.\\\\n\\\\n Use :attr:\`get_sprite\` to get a sprite by name.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\"=\\"",
- "OP \\"[\\"",
- "OP \\"]\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"List of each :class:\`Actor\` on the stage.\\\\n\\\\n Includes :class:\`Watchers \` as well as :class:\`Sprites\\\\n \`.\\\\n\\\\n Sprites in :attr:\`sprites\` but not in actors will be added to actors on\\\\n save.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"variables\\"",
- "OP \\"=\\"",
- "OP \\"{\\"",
- "OP \\"}\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\":class:\`dict\` of global :class:\`Variables \` by name.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"lists\\"",
- "OP \\"=\\"",
- "OP \\"{\\"",
- "OP \\"}\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\":class:\`dict\` of global :class:\`Lists \` by name.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"thumbnail\\"",
- "OP \\"=\\"",
- "NAME \\"None\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"An :class:\`Image\` with a screenshot of the project.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"tempo\\"",
- "OP \\"=\\"",
- "NUMBER \\"60\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The tempo in BPM used for note blocks.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"notes\\"",
- "OP \\"=\\"",
- "NAME \\"u\\"",
- "STRING \\"Made with Kurt\\\\\\\\nhttp://github.com/blob8108/kurt\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"Notes about the project, aka project comments.\\\\n\\\\n Displayed on the website next to the project.\\\\n\\\\n Line endings will be converted to \`\`\\\\\\\\\\\\\\\\n\`\`.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"author\\"",
- "OP \\"=\\"",
- "NAME \\"u\\"",
- "STRING \\"\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The username of the project's author, eg. \`\`'blob8108'\`\`.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"__repr__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "STRING \\"<%s.%s()>\\"",
- "OP \\"%\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"__class__\\"",
- "OP \\".\\"",
- "NAME \\"__module__\\"",
- "OP \\",\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"__class__\\"",
- "OP \\".\\"",
- "NAME \\"__name__\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"get_sprite\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Get a sprite from :attr:\`sprites\` by name.\\\\n\\\\n Returns None if the sprite isn't found.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"for\\"",
- "NAME \\"sprite\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"sprite\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\"==\\"",
- "NAME \\"name\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "NAME \\"sprite\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "OP \\"@\\"",
- "NAME \\"property\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"format\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"The file format of the project.\\\\n\\\\n :class:\`Project\` is mainly a universal representation, and so a project\\\\n has no specfic format. This is the format the project was loaded with.\\\\n To convert to a different format, use :attr:\`save()\`.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "OP \\"@\\"",
- "NAME \\"classmethod\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"load\\"",
- "OP \\"(\\"",
- "NAME \\"cls\\"",
- "OP \\",\\"",
- "NAME \\"path\\"",
- "OP \\",\\"",
- "NAME \\"format\\"",
- "OP \\"=\\"",
- "NAME \\"None\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Load project from file.\\\\n\\\\n Use \`\`format\`\` to specify the file format to use.\\\\n\\\\n Path can be a file-like object, in which case format is required.\\\\n Otherwise, can guess the appropriate format from the extension.\\\\n\\\\n If you pass a file-like object, you're responsible for closing the\\\\n file.\\\\n\\\\n :param path: Path or file pointer.\\\\n :param format: :attr:\`KurtFileFormat.name\` eg. \`\`\\\\\\"scratch14\\\\\\"\`\`.\\\\n Overrides the extension.\\\\n\\\\n :raises: :class:\`UnknownFormat\` if the extension is unrecognised.\\\\n :raises: :py:class:\`ValueError\` if the format doesn't exist.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"path_was_string\\"",
- "OP \\"=\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"path\\"",
- "OP \\",\\"",
- "NAME \\"basestring\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"path_was_string\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "OP \\"(\\"",
- "NAME \\"folder\\"",
- "OP \\",\\"",
- "NAME \\"filename\\"",
- "OP \\")\\"",
- "OP \\"=\\"",
- "NAME \\"os\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\".\\"",
- "NAME \\"split\\"",
- "OP \\"(\\"",
- "NAME \\"path\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "OP \\"(\\"",
- "NAME \\"name\\"",
- "OP \\",\\"",
- "NAME \\"extension\\"",
- "OP \\")\\"",
- "OP \\"=\\"",
- "NAME \\"os\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\".\\"",
- "NAME \\"splitext\\"",
- "OP \\"(\\"",
- "NAME \\"filename\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"format\\"",
- "NAME \\"is\\"",
- "NAME \\"None\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"plugin\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"Kurt\\"",
- "OP \\".\\"",
- "NAME \\"get_plugin\\"",
- "OP \\"(\\"",
- "NAME \\"extension\\"",
- "OP \\"=\\"",
- "NAME \\"extension\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"plugin\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"UnknownFormat\\"",
- "OP \\"(\\"",
- "NAME \\"extension\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"fp\\"",
- "OP \\"=\\"",
- "NAME \\"open\\"",
- "OP \\"(\\"",
- "NAME \\"path\\"",
- "OP \\",\\"",
- "STRING \\"rb\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"else\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"fp\\"",
- "OP \\"=\\"",
- "NAME \\"path\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"assert\\"",
- "NAME \\"format\\"",
- "OP \\",\\"",
- "STRING \\"Format is required\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"plugin\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"Kurt\\"",
- "OP \\".\\"",
- "NAME \\"get_plugin\\"",
- "OP \\"(\\"",
- "NAME \\"format\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"plugin\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"ValueError\\"",
- "OP \\",\\"",
- "STRING \\"Unknown format %r\\"",
- "OP \\"%\\"",
- "NAME \\"format\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"project\\"",
- "OP \\"=\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"load\\"",
- "OP \\"(\\"",
- "NAME \\"fp\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"path_was_string\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"fp\\"",
- "OP \\".\\"",
- "NAME \\"close\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"project\\"",
- "OP \\".\\"",
- "NAME \\"convert\\"",
- "OP \\"(\\"",
- "NAME \\"plugin\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"path\\"",
- "OP \\",\\"",
- "NAME \\"basestring\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"project\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"path\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"project\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"project\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\"=\\"",
- "NAME \\"name\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"return\\"",
- "NAME \\"project\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Return a new Project instance, deep-copying all the attributes.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\"=\\"",
- "NAME \\"Project\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\".\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\".\\"",
- "NAME \\"project\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"for\\"",
- "NAME \\"sprite\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"s\\"",
- "OP \\"=\\"",
- "NAME \\"sprite\\"",
- "OP \\".\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"s\\"",
- "OP \\".\\"",
- "NAME \\"project\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"s\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"actor\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"actor\\"",
- "OP \\",\\"",
- "NAME \\"Sprite\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"get_sprite\\"",
- "OP \\"(\\"",
- "NAME \\"actor\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"else\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"a\\"",
- "OP \\"=\\"",
- "NAME \\"actor\\"",
- "OP \\".\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"a\\"",
- "OP \\",\\"",
- "NAME \\"Watcher\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"a\\"",
- "OP \\".\\"",
- "NAME \\"target\\"",
- "OP \\",\\"",
- "NAME \\"Project\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"a\\"",
- "OP \\".\\"",
- "NAME \\"target\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"elif\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"a\\"",
- "OP \\".\\"",
- "NAME \\"target\\"",
- "OP \\",\\"",
- "NAME \\"Stage\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"a\\"",
- "OP \\".\\"",
- "NAME \\"target\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"else\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"a\\"",
- "OP \\".\\"",
- "NAME \\"target\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"get_sprite\\"",
- "OP \\"(\\"",
- "NAME \\"a\\"",
- "OP \\".\\"",
- "NAME \\"target\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"a\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"variables\\"",
- "OP \\"=\\"",
- "NAME \\"dict\\"",
- "OP \\"(\\"",
- "OP \\"(\\"",
- "NAME \\"n\\"",
- "OP \\",\\"",
- "NAME \\"v\\"",
- "OP \\".\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NAME \\"for\\"",
- "OP \\"(\\"",
- "NAME \\"n\\"",
- "OP \\",\\"",
- "NAME \\"v\\"",
- "OP \\")\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"variables\\"",
- "OP \\".\\"",
- "NAME \\"items\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"lists\\"",
- "OP \\"=\\"",
- "NAME \\"dict\\"",
- "OP \\"(\\"",
- "OP \\"(\\"",
- "NAME \\"n\\"",
- "OP \\",\\"",
- "NAME \\"l\\"",
- "OP \\".\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NAME \\"for\\"",
- "OP \\"(\\"",
- "NAME \\"n\\"",
- "OP \\",\\"",
- "NAME \\"l\\"",
- "OP \\")\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"lists\\"",
- "OP \\".\\"",
- "NAME \\"items\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"thumbnail\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"thumbnail\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"tempo\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"tempo\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"notes\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"notes\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"author\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"author\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"return\\"",
- "NAME \\"p\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"convert\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"format\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Convert the project in-place to a different file format.\\\\n\\\\n Returns a list of :class:\`UnsupportedFeature\` objects, which may give\\\\n warnings about the conversion.\\\\n\\\\n :param format: :attr:\`KurtFileFormat.name\` eg. \`\`\\\\\\"scratch14\\\\\\"\`\`.\\\\n\\\\n :raises: :class:\`ValueError\` if the format doesn't exist.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"Kurt\\"",
- "OP \\".\\"",
- "NAME \\"get_plugin\\"",
- "OP \\"(\\"",
- "NAME \\"format\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"return\\"",
- "NAME \\"list\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_normalize\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"save\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"None\\"",
- "OP \\",\\"",
- "NAME \\"debug\\"",
- "OP \\"=\\"",
- "NAME \\"False\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Save project to file.\\\\n\\\\n :param path: Path or file pointer.\\\\n\\\\n If you pass a file pointer, you're responsible for closing\\\\n it.\\\\n\\\\n If path is not given, the :attr:\`path\` attribute is used,\\\\n usually the original path given to :attr:\`load()\`.\\\\n\\\\n If \`path\` has the extension of an existing plugin, the\\\\n project will be converted using :attr:\`convert\`.\\\\n Otherwise, the extension will be replaced with the\\\\n extension of the current plugin.\\\\n\\\\n (Note that log output for the conversion will be printed\\\\n to stdout. If you want to deal with the output, call\\\\n :attr:\`convert\` directly.)\\\\n\\\\n If the path ends in a folder instead of a file, the\\\\n filename is based on the project's :attr:\`name\`.\\\\n\\\\n :param debug: If true, return debugging information from the format\\\\n plugin instead of the path.\\\\n\\\\n :raises: :py:class:\`ValueError\` if there's no path or name.\\\\n\\\\n :returns: path to the saved file.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"copy\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"plugin\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# require path\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"path\\"",
- "NAME \\"or\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"ValueError\\"",
- "OP \\",\\"",
- "STRING \\"path is required\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\",\\"",
- "NAME \\"basestring\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "COMMENT \\"# split path\\"",
- "NL \\"\\\\n\\"",
- "INDENT \\" \\"",
- "OP \\"(\\"",
- "NAME \\"folder\\"",
- "OP \\",\\"",
- "NAME \\"filename\\"",
- "OP \\")\\"",
- "OP \\"=\\"",
- "NAME \\"os\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\".\\"",
- "NAME \\"split\\"",
- "OP \\"(\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "OP \\"(\\"",
- "NAME \\"name\\"",
- "OP \\",\\"",
- "NAME \\"extension\\"",
- "OP \\")\\"",
- "OP \\"=\\"",
- "NAME \\"os\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\".\\"",
- "NAME \\"splitext\\"",
- "OP \\"(\\"",
- "NAME \\"filename\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# get plugin from extension\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"path\\"",
- "OP \\":\\"",
- "COMMENT \\"# only if not using self.path\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"try\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"plugin\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"Kurt\\"",
- "OP \\".\\"",
- "NAME \\"get_plugin\\"",
- "OP \\"(\\"",
- "NAME \\"extension\\"",
- "OP \\"=\\"",
- "NAME \\"extension\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"except\\"",
- "NAME \\"ValueError\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"pass\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# build output path\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"name\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"name\\"",
- "OP \\"=\\"",
- "NAME \\"_clean_filename\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"name\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"ValueError\\"",
- "OP \\",\\"",
- "STRING \\"name is required\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"filename\\"",
- "OP \\"=\\"",
- "NAME \\"name\\"",
- "OP \\"+\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"extension\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"os\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\".\\"",
- "NAME \\"join\\"",
- "OP \\"(\\"",
- "NAME \\"folder\\"",
- "OP \\",\\"",
- "NAME \\"filename\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# open\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"fp\\"",
- "OP \\"=\\"",
- "NAME \\"open\\"",
- "OP \\"(\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "OP \\",\\"",
- "STRING \\"wb\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"else\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"fp\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"path\\"",
- "OP \\"=\\"",
- "NAME \\"None\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"plugin\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"ValueError\\"",
- "OP \\",\\"",
- "STRING \\"must convert project to a format before saving\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"m\\"",
- "NAME \\"in\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"convert\\"",
- "OP \\"(\\"",
- "NAME \\"plugin\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"print\\"",
- "NAME \\"m\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"result\\"",
- "OP \\"=\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"_save\\"",
- "OP \\"(\\"",
- "NAME \\"fp\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"path\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"fp\\"",
- "OP \\".\\"",
- "NAME \\"close\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"return\\"",
- "NAME \\"result\\"",
- "NAME \\"if\\"",
- "NAME \\"debug\\"",
- "NAME \\"else\\"",
- "NAME \\"p\\"",
- "OP \\".\\"",
- "NAME \\"path\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"_save\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"fp\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\".\\"",
- "NAME \\"save\\"",
- "OP \\"(\\"",
- "NAME \\"fp\\"",
- "OP \\",\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"_normalize\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Convert the project to a standardised form for the current plugin.\\\\n\\\\n Called after loading, before saving, and when converting to a new\\\\n format.\\\\n\\\\n Yields UnsupportedFeature instances.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"unique_sprite_names\\"",
- "OP \\"=\\"",
- "NAME \\"set\\"",
- "OP \\"(\\"",
- "NAME \\"sprite\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "NAME \\"for\\"",
- "NAME \\"sprite\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"len\\"",
- "OP \\"(\\"",
- "NAME \\"unique_sprite_names\\"",
- "OP \\")\\"",
- "OP \\"<\\"",
- "NAME \\"len\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"ValueError\\"",
- "OP \\",\\"",
- "STRING \\"Sprite names must be unique\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# sync self.sprites and self.actors\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"sprite\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"sprite\\"",
- "NAME \\"not\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"sprite\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"actor\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"actor\\"",
- "OP \\",\\"",
- "NAME \\"Sprite\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"actor\\"",
- "NAME \\"not\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"ValueError\\"",
- "OP \\",\\"",
- "STRING \\"Can't have sprite on stage that isn't in sprites\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# normalize Scriptables\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\".\\"",
- "NAME \\"_normalize\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"for\\"",
- "NAME \\"sprite\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"sprite\\"",
- "OP \\".\\"",
- "NAME \\"_normalize\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# normalize actors\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"actor\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"actor\\"",
- "OP \\",\\"",
- "NAME \\"Scriptable\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"actor\\"",
- "OP \\".\\"",
- "NAME \\"_normalize\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# make Watchers if needed\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"thing\\"",
- "NAME \\"in\\"",
- "OP \\"[\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\"]\\"",
- "OP \\"+\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "OP \\"(\\"",
- "NAME \\"name\\"",
- "OP \\",\\"",
- "NAME \\"var\\"",
- "OP \\")\\"",
- "NAME \\"in\\"",
- "NAME \\"thing\\"",
- "OP \\".\\"",
- "NAME \\"variables\\"",
- "OP \\".\\"",
- "NAME \\"items\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"var\\"",
- "OP \\".\\"",
- "NAME \\"watcher\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"var\\"",
- "OP \\".\\"",
- "NAME \\"watcher\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"Watcher\\"",
- "OP \\"(\\"",
- "NAME \\"thing\\"",
- "OP \\",\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"Block\\"",
- "OP \\"(\\"",
- "STRING \\"var\\"",
- "OP \\",\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "OP \\",\\"",
- "NAME \\"is_visible\\"",
- "OP \\"=\\"",
- "NAME \\"False\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"var\\"",
- "OP \\".\\"",
- "NAME \\"watcher\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "OP \\"(\\"",
- "NAME \\"name\\"",
- "OP \\",\\"",
- "NAME \\"list_\\"",
- "OP \\")\\"",
- "NAME \\"in\\"",
- "NAME \\"thing\\"",
- "OP \\".\\"",
- "NAME \\"lists\\"",
- "OP \\".\\"",
- "NAME \\"items\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"list_\\"",
- "OP \\".\\"",
- "NAME \\"watcher\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"list_\\"",
- "OP \\".\\"",
- "NAME \\"watcher\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"Watcher\\"",
- "OP \\"(\\"",
- "NAME \\"thing\\"",
- "OP \\",\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"Block\\"",
- "OP \\"(\\"",
- "STRING \\"list\\"",
- "OP \\",\\"",
- "NAME \\"name\\"",
- "OP \\")\\"",
- "OP \\",\\"",
- "NAME \\"is_visible\\"",
- "OP \\"=\\"",
- "NAME \\"False\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"actors\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"list_\\"",
- "OP \\".\\"",
- "NAME \\"watcher\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# notes - line endings\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"notes\\"",
- "OP \\"=\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"notes\\"",
- "OP \\".\\"",
- "NAME \\"replace\\"",
- "OP \\"(\\"",
- "STRING \\"\\\\\\\\r\\\\\\\\n\\"",
- "OP \\",\\"",
- "STRING \\"\\\\\\\\n\\"",
- "OP \\")\\"",
- "OP \\".\\"",
- "NAME \\"replace\\"",
- "OP \\"(\\"",
- "STRING \\"\\\\\\\\r\\"",
- "OP \\",\\"",
- "STRING \\"\\\\\\\\n\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# convert scripts\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"convert_block\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "COMMENT \\"# convert block\\"",
- "NL \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"try\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"type\\"",
- "OP \\",\\"",
- "NAME \\"CustomBlockType\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "STRING \\"Custom Blocks\\"",
- "NAME \\"not\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\".\\"",
- "NAME \\"features\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NAME \\"BlockNotSupported\\"",
- "OP \\"(\\"",
- "NL \\"\\\\n\\"",
- "STRING \\"%s doesn't support custom blocks\\"",
- "NL \\"\\\\n\\"",
- "OP \\"%\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\".\\"",
- "NAME \\"display_name\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"else\\"",
- "OP \\":\\"",
- "COMMENT \\"# BlockType\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"pbt\\"",
- "OP \\"=\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"type\\"",
- "OP \\".\\"",
- "NAME \\"convert\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"except\\"",
- "NAME \\"BlockNotSupported\\"",
- "OP \\",\\"",
- "NAME \\"err\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"err\\"",
- "OP \\".\\"",
- "NAME \\"message\\"",
- "OP \\"+=\\"",
- "STRING \\". Caused by: %r\\"",
- "OP \\"%\\"",
- "NAME \\"block\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"err\\"",
- "OP \\".\\"",
- "NAME \\"block\\"",
- "OP \\"=\\"",
- "NAME \\"block\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"err\\"",
- "OP \\".\\"",
- "NAME \\"scriptable\\"",
- "OP \\"=\\"",
- "NAME \\"scriptable\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"err\\"",
- "OP \\".\\"",
- "NAME \\"args\\"",
- "OP \\"=\\"",
- "OP \\"(\\"",
- "NAME \\"err\\"",
- "OP \\".\\"",
- "NAME \\"message\\"",
- "OP \\",\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"getattr\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"type\\"",
- "OP \\",\\"",
- "STRING \\"_workaround\\"",
- "OP \\",\\"",
- "NAME \\"None\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"block\\"",
- "OP \\"=\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"type\\"",
- "OP \\".\\"",
- "NAME \\"_workaround\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"if\\"",
- "NAME \\"not\\"",
- "NAME \\"block\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"else\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"raise\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# convert args\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"args\\"",
- "OP \\"=\\"",
- "OP \\"[\\"",
- "OP \\"]\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"for\\"",
- "NAME \\"arg\\"",
- "NAME \\"in\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"args\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\",\\"",
- "NAME \\"Block\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"arg\\"",
- "OP \\"=\\"",
- "NAME \\"convert_block\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"elif\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\",\\"",
- "NAME \\"list\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"arg\\"",
- "OP \\"=\\"",
- "NAME \\"map\\"",
- "OP \\"(\\"",
- "NAME \\"convert_block\\"",
- "OP \\",\\"",
- "NAME \\"arg\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"args\\"",
- "OP \\".\\"",
- "NAME \\"append\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"args\\"",
- "OP \\"=\\"",
- "NAME \\"args\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"return\\"",
- "NAME \\"block\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"scriptable\\"",
- "NAME \\"in\\"",
- "OP \\"[\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\"]\\"",
- "OP \\"+\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"script\\"",
- "NAME \\"in\\"",
- "NAME \\"scriptable\\"",
- "OP \\".\\"",
- "NAME \\"scripts\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"script\\"",
- "OP \\",\\"",
- "NAME \\"Script\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"script\\"",
- "OP \\".\\"",
- "NAME \\"blocks\\"",
- "OP \\"=\\"",
- "NAME \\"map\\"",
- "OP \\"(\\"",
- "NAME \\"convert_block\\"",
- "OP \\",\\"",
- "NAME \\"script\\"",
- "OP \\".\\"",
- "NAME \\"blocks\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# workaround unsupported features\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"feature\\"",
- "NAME \\"in\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"Feature\\"",
- "OP \\".\\"",
- "NAME \\"FEATURES\\"",
- "OP \\".\\"",
- "NAME \\"values\\"",
- "OP \\"(\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"feature\\"",
- "NAME \\"not\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\".\\"",
- "NAME \\"features\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"x\\"",
- "NAME \\"in\\"",
- "NAME \\"feature\\"",
- "OP \\".\\"",
- "NAME \\"workaround\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"yield\\"",
- "NAME \\"UnsupportedFeature\\"",
- "OP \\"(\\"",
- "NAME \\"feature\\"",
- "OP \\",\\"",
- "NAME \\"x\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"# normalize supported features\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"feature\\"",
- "NAME \\"in\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"_plugin\\"",
- "OP \\".\\"",
- "NAME \\"features\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"feature\\"",
- "OP \\".\\"",
- "NAME \\"normalize\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"get_broadcasts\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"def\\"",
- "NAME \\"get_broadcasts\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\",\\"",
- "NAME \\"insert\\"",
- "OP \\")\\"",
- "NAME \\"in\\"",
- "NAME \\"zip\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"args\\"",
- "OP \\",\\"",
- "NAME \\"block\\"",
- "OP \\".\\"",
- "NAME \\"type\\"",
- "OP \\".\\"",
- "NAME \\"inserts\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"if\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\",\\"",
- "NAME \\"Block\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"b\\"",
- "NAME \\"in\\"",
- "NAME \\"get_broadcasts\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"yield\\"",
- "NAME \\"b\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"elif\\"",
- "NAME \\"isinstance\\"",
- "OP \\"(\\"",
- "NAME \\"arg\\"",
- "OP \\",\\"",
- "NAME \\"list\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"arg_block\\"",
- "NAME \\"in\\"",
- "NAME \\"arg\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"b\\"",
- "NAME \\"in\\"",
- "NAME \\"get_broadcasts\\"",
- "OP \\"(\\"",
- "NAME \\"arg_block\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"yield\\"",
- "NAME \\"b\\"",
- "NEWLINE \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"elif\\"",
- "NAME \\"insert\\"",
- "OP \\".\\"",
- "NAME \\"kind\\"",
- "OP \\"==\\"",
- "STRING \\"broadcast\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"yield\\"",
- "NAME \\"arg\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"for\\"",
- "NAME \\"scriptable\\"",
- "NAME \\"in\\"",
- "OP \\"[\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"stage\\"",
- "OP \\"]\\"",
- "OP \\"+\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"sprites\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"script\\"",
- "NAME \\"in\\"",
- "NAME \\"scriptable\\"",
- "OP \\".\\"",
- "NAME \\"scripts\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"block\\"",
- "NAME \\"in\\"",
- "NAME \\"script\\"",
- "OP \\".\\"",
- "NAME \\"blocks\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"for\\"",
- "NAME \\"b\\"",
- "NAME \\"in\\"",
- "NAME \\"get_broadcasts\\"",
- "OP \\"(\\"",
- "NAME \\"block\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"yield\\"",
- "NAME \\"b\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"UnsupportedFeature\\"",
- "OP \\"(\\"",
- "NAME \\"object\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"The plugin doesn't support this Feature.\\\\n\\\\n Output once by Project.convert for each occurence of the feature.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"__init__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"feature\\"",
- "OP \\",\\"",
- "NAME \\"obj\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"feature\\"",
- "OP \\"=\\"",
- "NAME \\"kurt\\"",
- "OP \\".\\"",
- "NAME \\"plugin\\"",
- "OP \\".\\"",
- "NAME \\"Feature\\"",
- "OP \\".\\"",
- "NAME \\"get\\"",
- "OP \\"(\\"",
- "NAME \\"feature\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"obj\\"",
- "OP \\"=\\"",
- "NAME \\"obj\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"__repr__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "STRING \\"<%s.%s(%s)>\\"",
- "OP \\"%\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"__class__\\"",
- "OP \\".\\"",
- "NAME \\"__module__\\"",
- "OP \\",\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"__class__\\"",
- "OP \\".\\"",
- "NAME \\"__name__\\"",
- "OP \\",\\"",
- "NAME \\"unicode\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"__str__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "STRING \\"UnsupportedFeature: %s\\"",
- "OP \\"%\\"",
- "NAME \\"unicode\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"def\\"",
- "NAME \\"__unicode__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"return\\"",
- "NAME \\"u\\"",
- "STRING \\"%r: %r\\"",
- "OP \\"%\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"feature\\"",
- "OP \\".\\"",
- "NAME \\"name\\"",
- "OP \\",\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"obj\\"",
- "OP \\")\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#-- Errors --#\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"UnknownFormat\\"",
- "OP \\"(\\"",
- "NAME \\"Exception\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"The file extension is not recognised.\\\\n\\\\n Raised when :class:\`Project\` can't find a valid format plugin to handle the\\\\n file extension.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"pass\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"UnknownBlock\\"",
- "OP \\"(\\"",
- "NAME \\"Exception\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"A :class:\`Block\` with the given command or type cannot be found.\\\\n\\\\n Raised by :attr:\`BlockType.get\`.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"BlockNotSupported\\"",
- "OP \\"(\\"",
- "NAME \\"Exception\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"The plugin doesn't support this Block.\\\\n\\\\n Raised by :attr:\`Block.convert\` when it can't find a\\\\n :class:\`PluginBlockType\` for the given plugin.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"pass\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"VectorImageError\\"",
- "OP \\"(\\"",
- "NAME \\"Exception\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Tried to construct a raster image from a vector format image file.\\\\n\\\\n You shouldn't usally get this error, because Feature(\\\\\\"Vector Images\\\\\\") will\\\\n give a warning instead when the Project is converted.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NAME \\"pass\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "COMMENT \\"#-- Actors & Scriptables --#\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"Actor\\"",
- "OP \\"(\\"",
- "NAME \\"object\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"An object that goes on the project stage.\\\\n\\\\n Subclasses include :class:\`Watcher\` or :class:\`Sprite\`.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "DEDENT \\"\\"",
- "NAME \\"class\\"",
- "NAME \\"Scriptable\\"",
- "OP \\"(\\"",
- "NAME \\"object\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "STRING \\"Superclass for all scriptable objects.\\\\n\\\\n Subclasses are :class:\`Stage\` and :class:\`Sprite\`.\\\\n\\\\n \\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"def\\"",
- "NAME \\"__init__\\"",
- "OP \\"(\\"",
- "NAME \\"self\\"",
- "OP \\",\\"",
- "NAME \\"project\\"",
- "OP \\")\\"",
- "OP \\":\\"",
- "NEWLINE \\"\\\\n\\"",
- "INDENT \\" \\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"project\\"",
- "OP \\"=\\"",
- "NAME \\"project\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The :class:\`Project\` this belongs to.\\"",
- "NEWLINE \\"\\\\n\\"",
- "NL \\"\\\\n\\"",
- "NAME \\"self\\"",
- "OP \\".\\"",
- "NAME \\"scripts\\"",
- "OP \\"=\\"",
- "OP \\"[\\"",
- "OP \\"]\\"",
- "NEWLINE \\"\\\\n\\"",
- "STRING \\"The contents of the scripting area.\\\\n\\\\n List containing :class:\`Scripts