From d33d71f223a8eaa1a5bc9ec25aac322f728a2300 Mon Sep 17 00:00:00 2001 From: Ben Small Date: Thu, 3 Feb 2022 13:52:41 -0800 Subject: [PATCH 1/3] Added safety measures to line parsing A line beginning with a comment, a section name, or an equals decorator ('===') would still have the rest of that line parsed as if it were part of a normal line for the current section. However, since no [section-related] start-of-line processing had occurred for that line, the objects accessed during parsing could be stale, incorrect, or non-existent. This prevents this by disallowing additional content after section names and equals decorators, and making comments transparent to start-of-line detection. (It also whites-out start-of-line comments for additional transparency to later processing.) (Note: This commit also makes PuzzleScript less tolerant to stray right parentheses.) --- src/js/compiler.js | 5 ++++- src/js/parser.js | 43 +++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/js/compiler.js b/src/js/compiler.js index 0561c9a05..048ae3b33 100644 --- a/src/js/compiler.js +++ b/src/js/compiler.js @@ -2675,6 +2675,9 @@ function loadFile(str) { formatHomePage(state); delete state.commentLevel; + delete state.line_should_end; + delete state.line_should_end_because; + delete state.sol_after_comment; delete state.names; delete state.abbrevNames; delete state.objects_candname; @@ -2789,4 +2792,4 @@ function qualifyURL(url) { var a = document.createElement('a'); a.href = url; return a.href; -} \ No newline at end of file +} diff --git a/src/js/parser.js b/src/js/parser.js index d760e64c7..574504279 100644 --- a/src/js/parser.js +++ b/src/js/parser.js @@ -283,6 +283,11 @@ var codeMirrorFn = function() { section: state.section, visitedSections: state.visitedSections.concat([]), + line_should_end: state.line_should_end, + line_should_end_because: state.line_should_end_because, + + sol_after_comment: state.sol_after_comment, + objects_candname: state.objects_candname, objects_section: state.objects_section, objects_spritematrix: state.objects_spritematrix.concat([]), @@ -324,10 +329,11 @@ var codeMirrorFn = function() { }, token: function(stream, state) { var mixedCase = stream.string; - var sol = stream.sol(); - if (sol) { + var normal_sol = stream.sol(); + if (normal_sol) { stream.string = stream.string.toLowerCase(); state.tokenIndex=0; + state.line_should_end = false; /* if (state.lineNumber==undefined) { state.lineNumber=1; } @@ -336,6 +342,12 @@ var codeMirrorFn = function() { }*/ } + // White-out initial comments to reduce parser confusion (e.g., code that accesses and reparses stream.string) + if (state.sol_after_comment === true) { + stream.string = ' '.repeat(stream.pos) + stream.string.substr(stream.pos); + } + var sol = normal_sol || state.sol_after_comment; + state.sol_after_comment = false; function registerOriginalCaseName(candname){ @@ -361,16 +373,11 @@ var codeMirrorFn = function() { if (ch === '(' && state.tokenIndex !== -4) { // tokenIndex -4 indicates message command stream.next(); state.commentLevel++; - } else if (ch === ')') { - stream.next(); - if (state.commentLevel > 0) { - state.commentLevel--; - if (state.commentLevel === 0) { - return 'comment'; - } - } } if (state.commentLevel > 0) { + if (sol) { + state.sol_after_comment = true; + } while (true) { stream.eatWhile(/[^\(\)]+/); @@ -400,17 +407,27 @@ var codeMirrorFn = function() { return blankLineHandle(state); } + if (state.line_should_end && !stream.eol()) { + logError('Only comments should go after ' + state.line_should_end_because + ' on a line.', state.lineNumber); + stream.skipToEnd(); + return 'ERROR'; + } + // if (sol) { //MATCH '==="s AT START OF LINE if (sol && stream.match(reg_equalsrow, true)) { + state.line_should_end = true; + state.line_should_end_because = 'an equals decorator (\'===\')'; return 'EQUALSBIT'; } //MATCH SECTION NAME if (sol && stream.match(reg_sectionNames, true)) { state.section = stream.string.slice(0, stream.pos).trim(); + state.line_should_end = true; + state.line_should_end_because = 'a section name'; if (state.visitedSections.indexOf(state.section) >= 0) { logError('cannot duplicate sections (you tried to duplicate \"' + state.section.toUpperCase() + '").', state.lineNumber); } @@ -1252,6 +1269,12 @@ var codeMirrorFn = function() { section: '', visitedSections: [], + line_should_end: false, + line_should_end_because: '', + + sol_after_comment: false, + + objects_candname: '', objects_section: 0, //whether reading name/color/spritematrix objects_spritematrix: [], From f8b2d938b70f8d02e48cf8c1022ab6de033e41f2 Mon Sep 17 00:00:00 2001 From: Ben Small Date: Thu, 3 Feb 2022 14:54:28 -0800 Subject: [PATCH 2/3] Added / amended tests for cbcf4aaa (line parsing issues) --- src/tests/resources/errormessage_testdata.js | 8 ++++++-- src/tests/resources/testdata.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tests/resources/errormessage_testdata.js b/src/tests/resources/errormessage_testdata.js index c94729e5d..000e7d3ff 100644 --- a/src/tests/resources/errormessage_testdata.js +++ b/src/tests/resources/errormessage_testdata.js @@ -221,7 +221,7 @@ var errormessage_testdata = [ ["title Octat\nauthor increpare\nhomepage www.increpare.com\n\nnoundo\nrequire_player_movement\n\n(A port of a flash game I made. The original's here:\n\nhttp://ded.increpare.com/~locus/octat/\n\n)\n\n========\nOBJECTS\n========\n\nBackground\npurple\n.....\n.000.\n.000.\n.000.\n.....\n\nactivetile\npink red\n00000\n0...0\n0...0\n0...0\n00000\n\nTarget\nRED\n0...0\n.0.0.\n..0..\n.0.0.\n0...0\n\nPlayer\nwhite\n.....\n.000.\n.000.\n.000.\n.....\n\nvoid 0\nblack\n\ntemp\nblack\n\n=======\nLEGEND\n=======\n\n. = Background\nP = Player and activetile\na = activetile\nx = Target\ny = target and activetile\n\n=========\nSOUNDS\n=========\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nvoid\nactivetile\nplayer\ntemp\nTarget\n\n======\nRULES\n======\n\n[ > player | no activetile ] -> cancel\n[ > player | ] -> [ | player ]\n\n[ activetile | player ] -> [ temp | player ]\n[ no temp | player ] -> [activetile | player ]\n[ temp ] -> []\n\n[activetile void ] -> [ void ]\n\n==============\nWINCONDITIONS\n==============\n\nsome player on target\n\n=======\nLEVELS\n=======\n\nmessage level 1 of 8\n\n..........\n..........\n..........\n..........\n..........\n.x...ap...\n..........\n..........\n..........\n..........\n\nmessage level 2 of 8\n\n...........\n...........\n...........\n...........\n...........\n....xpa....\n...........\n...........\n...........\n...........\n\n\nmessage level 3 of 8\n\n\n...........\n...........\n...........\n...........\n..a........\n.axaaap....\n..a........\n...........\n...........\n...........\n\nmessage level 4 of 8\n\n\n...........\n...........\n...a.......\n..a.a......\n.a.a.a.....\na.aya.a.ap.\n.a.a.a.....\n..a.a......\n...a.......\n...........\n\nmessage level 5 of 8\n\n\n...........\n...........\n...........\n...........\naaaaaaaaaaa\n...y..ap...\naaaaaaaaaaa\n...........\n...........\n...........\n\nmessage level 6 of 8\n\n\n000000....0\n000000..0.0\n000000..0..\n000000000..\n....A...0.0\n.AY.A...AAP\n....A...0.0\n000000000..\n000000..0..\n000000..0.0\n000000....0\n\nmessage level 7 of 8\n\n\n..AAA...000\n.AY.A...AP.\n..AAA...000\n\nmessage level 8 of 8\n\n\n0AAAA..00\n0AAAA..00\nYAAAA..AP\n0AAAA..00\n0AAAA..00\n\nmessage the end\n\n\n\n",[],0] ], [ `ponies jumping synchronously, unfixed version`, - ["title Ponies Jumping Synchronously\nauthor vytah\n\nbackground_color #990044\ntext_color white\n\n========\nOBJECTS\n========\n\n\nBackground (special, automatically placed in its own layer)\nlightblue\n\nJumpVariableA\nlightblue\n0...0\n.000.\n.0.0.\n.000.\n0...0\n\nJumpVariableA1\nlightblue\n0...0\n..0..\n..0..\n..0..\n0...0\n\nJumpVariableA2\nlightblue\n0...0\n.0.0.\n.0.0.\n.0.0.\n0...0\n\nJumpVariableT\nlightblue\n..0..\n.000.\n.0.0.\n.000.\n.....\n\nJumpVariableT1\nlightblue\n..0..\n..0..\n..0..\n..0..\n.....\n\nJumpVariableT2\nlightblue\n..0..\n.0.0.\n.0.0.\n.0.0.\n.....\n\nJumpVariableB\nlightblue\n.....\n.000.\n.0.0.\n.000.\n..0..\n\nJumpVariableB1\nlightblue\n.....\n..0..\n..0..\n..0..\n..0..\n\nJumpVariableB2\nlightblue\n.....\n.0.0.\n.0.0.\n.0.0.\n..0..\n\nDirt\nbrown darkbrown\n00000\n01000\n00000\n00010\n00000\n\nTunnel\nbrown darkbrown\n00000\n01000\n.....\n.....\n.....\n\n\nGrass\nbrown lightgreen green darkBrown\n11211\n21020\n00000\n00030\n00000\n\nExit\npink red\n.1.1.\n10101\n10001\n.101.\n..1..\n\nWoodenWall\nBrown orange\n.111.\n.001.\n.111.\n.100.\n.111.\n\nTeleport\nBrown darkBrown pink white\n23332\n02220\n00000\n00010\n00000\n\nFire\nred orange yellow\n..0..\n.00..\n0110.\n01210\n.020.\n\nTwiLeft\npurple\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nTwiRight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nTeleportingTwilight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nRdLeft\n#00dddd\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nRdRight\n#00dddd\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nAbLeft\nyellow red\n..1..\n.01..\n00...\n.0000\n.0.0.\n\nAbRight\nyellow red\n..1..\n..10.\n...00\n0000.\n.0.0.\n\nAjLeft\norange\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nAjRight\norange\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nDeadPony\nlightGray darkGray\n.111.\n10001\n10101\n10001\n10101\n\nBoulder\nlightGray darkGray\n.....\n.111.\n10001\n10001\n.111.\n\n=======\nLEGEND\n=======\n\nApplejack=AjLeft or AjRight\nRainbowDash=RdLeft or RdRight\nTwilight=TwiLeft or TwiRight\nAppleBloom=AbLeft or AbRight\n(NotPegasus=Twilight or Applejack or AppleBloom or TeleportingTwilight)\nPlayer=Twilight or Applejack or AppleBloom or RainbowDash\nObstacle=Grass or Dirt or DeadPony or WoodenWall or Teleport or Boulder\nJumpObstacle=Obstacle or Player or Tunnel\nJumpObstacleForFillies=Obstacle or Player\nJumpVariablePositiveA=JumpVariableA1 or JumpVariableA2\nJumpVariablePositiveT=JumpVariableT1 or JumpVariableT2\nJumpVariablePositiveB=JumpVariableB1 or JumpVariableB2\n\n. = Background\n# = Dirt\n~ = Grass\n| = WoodenWall\nT = TwiRight\nA = AjRight\nD = RdRight\nB = AbRight\nJ = JumpVariableA\nH = JumpVariableT\nL = JumpVariableB\nE = Exit\n^ = Teleport\nF = Fire\nO = Boulder\n- = Tunnel\n\n=========\nSOUNDS\n=========\n\nsfx0 47251907 (aj push)\nsfx1 13930501 (twi zap)\nsfx2 99083104 (death)\nsfx3 12667901 (twi teleport)\nsfx4 60310105 (jump)\nsfx5 58764102 (rd smash)\nsfx7 74120302 (aj buck)\nendlevel 64815700\n\n\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nJumpVariableA, JumpVariablePositiveA, JumpVariableT,JumpVariablePositiveT, JumpVariableB, JumpVariablePositiveB\nExit, Fire, Tunnel\nPlayer, Obstacle, TeleportingTwilight\n\n======\nRULES\n======\n\n[> Player |Stationary Player] -> cancel\n[> Player |< Player] -> cancel\n\n[> Applejack| Tunnel] -> [Applejack|Tunnel]\n[> RainbowDash| Tunnel] -> [RainbowDash|Tunnel]\n[> Twilight| Tunnel] -> [Twilight|Tunnel]\nVertical [> AppleBloom|Tunnel] -> [AppleBloom|Tunnel]\n\n[Left TwiRight] -> [Left TwiLeft]\n[Right TwiLeft] -> [Right TwiRight]\n[Left RdRight] -> [Left RdLeft]\n[Right RdLeft] -> [Right RdRight]\n[Left AjRight] -> [Left AjLeft]\n[Right AjLeft] -> [Right AjRight]\n[Left AbRight] -> [Left AbLeft]\n[Right AbLeft] -> [Right AbRight]\n\nRight[Action Applejack|WoodenWall] -> [AjLeft|]sfx7\nLeft[Action Applejack|WoodenWall] -> [AjRight|]sfx7\n\nDown[Action Twilight|Teleport][no Player|Teleport]-> [|Teleport][TeleportingTwilight|Teleport] sfx3\nlate[TeleportingTwilight]->[TwiRight]\n\n\nUP [ Up Applejack | No Obstacle No Player no tunnel] [JumpVariableA] -> [ Up Applejack | ] [JumpVariableA2] sfx4\nDOWN [ Up Applejack | no obstacle No Player no tunnel ][JumpVariablePositiveA] -> [ Applejack | ][JumpVariablePositiveA]\nDOWN [ Up Applejack | no obstacle No Player no tunnel][JumpVariableA2] -> [ Applejack | ][JumpVariableA2]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA1] -> [ | Applejack ][JumpVariableA]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA2] -> [ | Applejack ][JumpVariableA1]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA1] -> [ Applejack|JumpObstacle ][JumpVariableA]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA2] -> [ Applejack|JumpObstacle ][JumpVariableA1]\nLATE DOWN [ Applejack | NO obstacle No Player no tunnel][JumpVariableA] -> [ | Applejack ][JumpVariableA]\nLATE DOWN [ Applejack | Obstacle ][JumpVariablePositiveA] -> [ Applejack | Obstacle ][JumpVariableA]\n\n\nUP [ Up Twilight | No Obstacle No Player no tunnel] [JumpVariableT] -> [ Up Twilight | ] [JumpVariableT2] sfx4\nDOWN [ Up Twilight | no obstacle No Player no tunnel ][JumpVariablePositiveT] -> [ Twilight | ][JumpVariablePositiveT]\nDOWN [ Up Twilight | no obstacle No Player no tunnel][JumpVariableT2] -> [ Twilight | ][JumpVariableT2]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT1] -> [ | Twilight ][JumpVariableT]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT2] -> [ | Twilight ][JumpVariableT1]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT1] -> [ Twilight|JumpObstacle ][JumpVariableT]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT2] -> [ Twilight|JumpObstacle ][JumpVariableT1]\nLATE DOWN [ Twilight | NO obstacle No Player no tunnel][JumpVariableT] -> [ | Twilight ][JumpVariableT]\nLATE DOWN [ Twilight | Obstacle ][JumpVariablePositiveT] -> [ Twilight | Obstacle ][JumpVariableT]\n\n\nUP [ Up AppleBloom | No Obstacle No Player no tunnel] [JumpVariableB] -> [ Up AppleBloom | ] [JumpVariableB2] sfx4\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel ][JumpVariablePositiveB] -> [ AppleBloom | ][JumpVariablePositiveB]\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel][JumpVariableB2] -> [ AppleBloom | ][JumpVariableB2]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB1][ -> [ | AppleBloom ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB2] -> [ | AppleBloom ][JumpVariableB1]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB1] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB2] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB1]\nLATE DOWN [ AppleBloom | NO obstacle No Player no tunnel][JumpVariableB] -> [ | AppleBloom ][JumpVariableB]\nLATE DOWN [ AppleBloom | Obstacle ][JumpVariablePositiveB] -> [ AppleBloom | Obstacle ][JumpVariableB]\n)\n\nlate [Player Fire] -> [DeadPony Fire] sfx2\n\n[> Applejack|Boulder|no Obstacle No Player] -> [> Applejack| > Boulder |] sfx0\n[> RainbowDash|Boulder|no Obstacle No Player] -> [> RainbowDash||] sfx5\nRight [Action TwiRight|Boulder] -> [TwiRight|] sfx1\nLeft [Action TwiLeft|Boulder] -> [TwiLeft|] sfx1\n\n[Boulder Fire] -> [Boulder]\n\nlate down [Boulder|Player] -> [|DeadPony] sfx2\nlate down [Boulder| no Obstacle no Tunnel] -> [|Boulder no Fire]\nlate [Boulder Fire] -> [Boulder]\n\n==============\nWINCONDITIONS\n==============\n\nsome Player\nall Exit on Player\nno DeadPony\n\n\n=======\nLEVELS\n=======\n\n(message #1. Grab the Crystal Heart.)\n\n..........H\n...........\n.........E.\n..T....~~~~\n~~~~~~#####\n###########\n\n\nmessage #2. Applejack bucks and pushes.\n\n..........J\n..~~~~~~~~~\n...########\n.A.|.o...E#\n######.####\n###########\n\nmessage #3. Twilight teleports and zaps.\n\n...........H\n............\n............\n.T....E.O...\n~^~FFF~~~~^~\n############\n\nmessage #4. Rainbow Dash flies and smashes.\n\n#########\n....#..E#\n....O..##\n....#..##\n.D..#..##\n#########\n\nmessage #5. Rocks fall, everyone dies.\n\n.........J\n..........\n...~~~~~.~\n~~O..O...#\n##|A.O..E#\n##########\n\nmessage #6. Cooperate with friends.\n\nJ.....###\n......###\n...D..#.E\n....#..O#\n.A..O..|#\n~~~######\n#########\n\nmessage #7. Cooperate with family.\n\n##.......JL#####\n---..O.A.O.#...#\n###~.~~~~~.#..E#\n###.F..B..F-.###\n####.#####.#####\n################\n\n\nmessage #8. Help a filly get a cutie mark!\n~~~~~..........L\n#####.........D.\n###E-....O......\n######...O......\n#######.###...B.\n############~~~~\n\nmessage Aww... Still no cutie mark...\n\nmessage #9. Explore dangerous caves!\n\n.........##############\n.......###O############\nJHL..#####O############\n...#######O############\n..#####..-O------O-E###\n######..##O######O#####\n#####..###|...A..O.....\n####..####O###^.#######\n####.-----O-------...B.\n##########O############\n..........O..........T.\n############^##########\n\nmessage #10. Friendship is magic!\n\nJH.........###\n.......O.#.#OE\nDAT....|.#..O#\n~~~.~~~.~###O#\n.......F.#..O#\n########^#^###\n\nmessage #11. Evil enchantress.\n~~~~~...............JHL\n#####~~~~~~~~~~........\n################.......\n###......###...........\n###..O.O.F.....#.#..D..\n#E-..#B#.|O........A.T.\n#############.~~~~~~~~~\n#######################\n\n\nmessage #12. Equestrian Games.\n\n###############################\n#########O#####################\n#########O#####################\n###......O..................JHL\n###..O.#.O..............D......\n#E-..#B#.O.....................\n#########O#####################\n#........|.....................\n#########O#####..|.|.|.|.|.....\n#........O....##.#.#.#.#.#.A...\n############...################\n#############..................\n###############...F........T...\n###############################\n\nmessage Congratulations!\n\nmessage The Mushroom Kingdom is now safe!\n\nmessage I mean, the Crystal Empire.\n",["line 252 : You named an object \"|\", but this is a keyword. Don't do that!","line 261 : You named an object \"^\", but this is a keyword. Don't do that!","line 343 : Encountered an unexpected \"->\" inside square brackets. It's used to separate states, it has no place inside them >:| .","line 343 : Multiple opening brackets without closing brackets. Something fishy here. Every '[' has to be closed by a ']', and you can't nest them.","line 343 : Error, when specifying a rule, the number of matches (square bracketed bits) on the left hand side of the arrow must equal the number on the right"],2] + ["title Ponies Jumping Synchronously\nauthor vytah\n\nbackground_color #990044\ntext_color white\n\n========\nOBJECTS\n========\n\n\nBackground (special, automatically placed in its own layer)\nlightblue\n\nJumpVariableA\nlightblue\n0...0\n.000.\n.0.0.\n.000.\n0...0\n\nJumpVariableA1\nlightblue\n0...0\n..0..\n..0..\n..0..\n0...0\n\nJumpVariableA2\nlightblue\n0...0\n.0.0.\n.0.0.\n.0.0.\n0...0\n\nJumpVariableT\nlightblue\n..0..\n.000.\n.0.0.\n.000.\n.....\n\nJumpVariableT1\nlightblue\n..0..\n..0..\n..0..\n..0..\n.....\n\nJumpVariableT2\nlightblue\n..0..\n.0.0.\n.0.0.\n.0.0.\n.....\n\nJumpVariableB\nlightblue\n.....\n.000.\n.0.0.\n.000.\n..0..\n\nJumpVariableB1\nlightblue\n.....\n..0..\n..0..\n..0..\n..0..\n\nJumpVariableB2\nlightblue\n.....\n.0.0.\n.0.0.\n.0.0.\n..0..\n\nDirt\nbrown darkbrown\n00000\n01000\n00000\n00010\n00000\n\nTunnel\nbrown darkbrown\n00000\n01000\n.....\n.....\n.....\n\n\nGrass\nbrown lightgreen green darkBrown\n11211\n21020\n00000\n00030\n00000\n\nExit\npink red\n.1.1.\n10101\n10001\n.101.\n..1..\n\nWoodenWall\nBrown orange\n.111.\n.001.\n.111.\n.100.\n.111.\n\nTeleport\nBrown darkBrown pink white\n23332\n02220\n00000\n00010\n00000\n\nFire\nred orange yellow\n..0..\n.00..\n0110.\n01210\n.020.\n\nTwiLeft\npurple\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nTwiRight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nTeleportingTwilight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nRdLeft\n#00dddd\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nRdRight\n#00dddd\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nAbLeft\nyellow red\n..1..\n.01..\n00...\n.0000\n.0.0.\n\nAbRight\nyellow red\n..1..\n..10.\n...00\n0000.\n.0.0.\n\nAjLeft\norange\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nAjRight\norange\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nDeadPony\nlightGray darkGray\n.111.\n10001\n10101\n10001\n10101\n\nBoulder\nlightGray darkGray\n.....\n.111.\n10001\n10001\n.111.\n\n=======\nLEGEND\n=======\n\nApplejack=AjLeft or AjRight\nRainbowDash=RdLeft or RdRight\nTwilight=TwiLeft or TwiRight\nAppleBloom=AbLeft or AbRight\n(NotPegasus=Twilight or Applejack or AppleBloom or TeleportingTwilight)\nPlayer=Twilight or Applejack or AppleBloom or RainbowDash\nObstacle=Grass or Dirt or DeadPony or WoodenWall or Teleport or Boulder\nJumpObstacle=Obstacle or Player or Tunnel\nJumpObstacleForFillies=Obstacle or Player\nJumpVariablePositiveA=JumpVariableA1 or JumpVariableA2\nJumpVariablePositiveT=JumpVariableT1 or JumpVariableT2\nJumpVariablePositiveB=JumpVariableB1 or JumpVariableB2\n\n. = Background\n# = Dirt\n~ = Grass\n| = WoodenWall\nT = TwiRight\nA = AjRight\nD = RdRight\nB = AbRight\nJ = JumpVariableA\nH = JumpVariableT\nL = JumpVariableB\nE = Exit\n^ = Teleport\nF = Fire\nO = Boulder\n- = Tunnel\n\n=========\nSOUNDS\n=========\n\nsfx0 47251907 (aj push)\nsfx1 13930501 (twi zap)\nsfx2 99083104 (death)\nsfx3 12667901 (twi teleport)\nsfx4 60310105 (jump)\nsfx5 58764102 (rd smash)\nsfx7 74120302 (aj buck)\nendlevel 64815700\n\n\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nJumpVariableA, JumpVariablePositiveA, JumpVariableT,JumpVariablePositiveT, JumpVariableB, JumpVariablePositiveB\nExit, Fire, Tunnel\nPlayer, Obstacle, TeleportingTwilight\n\n======\nRULES\n======\n\n[> Player |Stationary Player] -> cancel\n[> Player |< Player] -> cancel\n\n[> Applejack| Tunnel] -> [Applejack|Tunnel]\n[> RainbowDash| Tunnel] -> [RainbowDash|Tunnel]\n[> Twilight| Tunnel] -> [Twilight|Tunnel]\nVertical [> AppleBloom|Tunnel] -> [AppleBloom|Tunnel]\n\n[Left TwiRight] -> [Left TwiLeft]\n[Right TwiLeft] -> [Right TwiRight]\n[Left RdRight] -> [Left RdLeft]\n[Right RdLeft] -> [Right RdRight]\n[Left AjRight] -> [Left AjLeft]\n[Right AjLeft] -> [Right AjRight]\n[Left AbRight] -> [Left AbLeft]\n[Right AbLeft] -> [Right AbRight]\n\nRight[Action Applejack|WoodenWall] -> [AjLeft|]sfx7\nLeft[Action Applejack|WoodenWall] -> [AjRight|]sfx7\n\nDown[Action Twilight|Teleport][no Player|Teleport]-> [|Teleport][TeleportingTwilight|Teleport] sfx3\nlate[TeleportingTwilight]->[TwiRight]\n\n\nUP [ Up Applejack | No Obstacle No Player no tunnel] [JumpVariableA] -> [ Up Applejack | ] [JumpVariableA2] sfx4\nDOWN [ Up Applejack | no obstacle No Player no tunnel ][JumpVariablePositiveA] -> [ Applejack | ][JumpVariablePositiveA]\nDOWN [ Up Applejack | no obstacle No Player no tunnel][JumpVariableA2] -> [ Applejack | ][JumpVariableA2]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA1] -> [ | Applejack ][JumpVariableA]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA2] -> [ | Applejack ][JumpVariableA1]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA1] -> [ Applejack|JumpObstacle ][JumpVariableA]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA2] -> [ Applejack|JumpObstacle ][JumpVariableA1]\nLATE DOWN [ Applejack | NO obstacle No Player no tunnel][JumpVariableA] -> [ | Applejack ][JumpVariableA]\nLATE DOWN [ Applejack | Obstacle ][JumpVariablePositiveA] -> [ Applejack | Obstacle ][JumpVariableA]\n\n\nUP [ Up Twilight | No Obstacle No Player no tunnel] [JumpVariableT] -> [ Up Twilight | ] [JumpVariableT2] sfx4\nDOWN [ Up Twilight | no obstacle No Player no tunnel ][JumpVariablePositiveT] -> [ Twilight | ][JumpVariablePositiveT]\nDOWN [ Up Twilight | no obstacle No Player no tunnel][JumpVariableT2] -> [ Twilight | ][JumpVariableT2]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT1] -> [ | Twilight ][JumpVariableT]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT2] -> [ | Twilight ][JumpVariableT1]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT1] -> [ Twilight|JumpObstacle ][JumpVariableT]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT2] -> [ Twilight|JumpObstacle ][JumpVariableT1]\nLATE DOWN [ Twilight | NO obstacle No Player no tunnel][JumpVariableT] -> [ | Twilight ][JumpVariableT]\nLATE DOWN [ Twilight | Obstacle ][JumpVariablePositiveT] -> [ Twilight | Obstacle ][JumpVariableT]\n\n\nUP [ Up AppleBloom | No Obstacle No Player no tunnel] [JumpVariableB] -> [ Up AppleBloom | ] [JumpVariableB2] sfx4\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel ][JumpVariablePositiveB] -> [ AppleBloom | ][JumpVariablePositiveB]\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel][JumpVariableB2] -> [ AppleBloom | ][JumpVariableB2]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB1][ -> [ | AppleBloom ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB2] -> [ | AppleBloom ][JumpVariableB1]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB1] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB2] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB1]\nLATE DOWN [ AppleBloom | NO obstacle No Player no tunnel][JumpVariableB] -> [ | AppleBloom ][JumpVariableB]\nLATE DOWN [ AppleBloom | Obstacle ][JumpVariablePositiveB] -> [ AppleBloom | Obstacle ][JumpVariableB]\n)\n\nlate [Player Fire] -> [DeadPony Fire] sfx2\n\n[> Applejack|Boulder|no Obstacle No Player] -> [> Applejack| > Boulder |] sfx0\n[> RainbowDash|Boulder|no Obstacle No Player] -> [> RainbowDash||] sfx5\nRight [Action TwiRight|Boulder] -> [TwiRight|] sfx1\nLeft [Action TwiLeft|Boulder] -> [TwiLeft|] sfx1\n\n[Boulder Fire] -> [Boulder]\n\nlate down [Boulder|Player] -> [|DeadPony] sfx2\nlate down [Boulder| no Obstacle no Tunnel] -> [|Boulder no Fire]\nlate [Boulder Fire] -> [Boulder]\n\n==============\nWINCONDITIONS\n==============\n\nsome Player\nall Exit on Player\nno DeadPony\n\n\n=======\nLEVELS\n=======\n\n(message #1. Grab the Crystal Heart.)\n\n..........H\n...........\n.........E.\n..T....~~~~\n~~~~~~#####\n###########\n\n\nmessage #2. Applejack bucks and pushes.\n\n..........J\n..~~~~~~~~~\n...########\n.A.|.o...E#\n######.####\n###########\n\nmessage #3. Twilight teleports and zaps.\n\n...........H\n............\n............\n.T....E.O...\n~^~FFF~~~~^~\n############\n\nmessage #4. Rainbow Dash flies and smashes.\n\n#########\n....#..E#\n....O..##\n....#..##\n.D..#..##\n#########\n\nmessage #5. Rocks fall, everyone dies.\n\n.........J\n..........\n...~~~~~.~\n~~O..O...#\n##|A.O..E#\n##########\n\nmessage #6. Cooperate with friends.\n\nJ.....###\n......###\n...D..#.E\n....#..O#\n.A..O..|#\n~~~######\n#########\n\nmessage #7. Cooperate with family.\n\n##.......JL#####\n---..O.A.O.#...#\n###~.~~~~~.#..E#\n###.F..B..F-.###\n####.#####.#####\n################\n\n\nmessage #8. Help a filly get a cutie mark!\n~~~~~..........L\n#####.........D.\n###E-....O......\n######...O......\n#######.###...B.\n############~~~~\n\nmessage Aww... Still no cutie mark...\n\nmessage #9. Explore dangerous caves!\n\n.........##############\n.......###O############\nJHL..#####O############\n...#######O############\n..#####..-O------O-E###\n######..##O######O#####\n#####..###|...A..O.....\n####..####O###^.#######\n####.-----O-------...B.\n##########O############\n..........O..........T.\n############^##########\n\nmessage #10. Friendship is magic!\n\nJH.........###\n.......O.#.#OE\nDAT....|.#..O#\n~~~.~~~.~###O#\n.......F.#..O#\n########^#^###\n\nmessage #11. Evil enchantress.\n~~~~~...............JHL\n#####~~~~~~~~~~........\n################.......\n###......###...........\n###..O.O.F.....#.#..D..\n#E-..#B#.|O........A.T.\n#############.~~~~~~~~~\n#######################\n\n\nmessage #12. Equestrian Games.\n\n###############################\n#########O#####################\n#########O#####################\n###......O..................JHL\n###..O.#.O..............D......\n#E-..#B#.O.....................\n#########O#####################\n#........|.....................\n#########O#####..|.|.|.|.|.....\n#........O....##.#.#.#.#.#.A...\n############...################\n#############..................\n###############...F........T...\n###############################\n\nmessage Congratulations!\n\nmessage The Mushroom Kingdom is now safe!\n\nmessage I mean, the Crystal Empire.\n",["line 252 : You named an object \"|\", but this is a keyword. Don't do that!","line 261 : You named an object \"^\", but this is a keyword. Don't do that!","line 349 : Name \")\", referred to in a rule, does not exist.","line 343 : Encountered an unexpected \"->\" inside square brackets. It's used to separate states, it has no place inside them >:| .","line 343 : Multiple opening brackets without closing brackets. Something fishy here. Every '[' has to be closed by a ']', and you can't nest them.","line 343 : Error, when specifying a rule, the number of matches (square bracketed bits) on the left hand side of the arrow must equal the number on the right","line 349 : A rule has to have an arrow in it. There's no arrow here! Consider reading up about rules - you're clearly doing something weird","line 349 : The start of a rule must consist of some number of directions (possibly 0), before the first bracket, specifying in what directions to look (with no direction specified, it applies in all four directions). It seems you've just entered \")\".","line 349 : This rule refers to nothing. What the heck? :O"],6] ], [ `notsnake`, @@ -449,6 +449,10 @@ var errormessage_testdata = [ ], [ "EDitor crash with opening parenthesis in level section in middle of line #784", - ["title Simple Block Pushing Game\nauthor David Skinner\nhomepage www.puzzlescript.net\n\n========\nOBJECTS\n========\n\nBackground\nLIGHTGREEN GREEN\n11111\n01111\n11101\n11111\n10111\n\n\nTarget\nDarkBlue\n.....\n.000.\n.0.0.\n.000.\n.....\n\nWall\nBROWN DARKBROWN\n00010\n11111\n01000\n11111\n00010\n\nPlayer\nBlack Orange White Blue\n.000.\n.111.\n22222\n.333.\n.3.3.\n\nCrate\nOrange\n00000\n0...0\n0...0\n0...0\n00000\n\n\n=======\nLEGEND\n=======\n\n. = Background\n# = Wall\nP = Player\n* = Crate\n@ = Crate and Target\nO = Target\n\nobstacle = crate or wall\n\n=======\nSOUNDS\n=======\n\nCrate MOVE 36772507\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nPlayer, Wall, Crate\nTarget\n\n======\nRULES\n======\n(\n[ > player | crate | obstacle ] -> cancel\n[ > player | wall ] -> cancel\n\n\n[ > Player | Crate | ] -> [ > Player | | Crate ]\n[ wall | > player | ] -> [ wall | wall | player ]\n\n)\n\n[ > player | crate ] -> [ > player | > crate ]\n[ wall | > player ] -> [ > wall | > player ]\n\n==============\nWINCONDITIONS\n==============\n\nAll Target on Crate\n\n=======\nLEVELS\n=======\n\n....\n....\n....\n....\n\n\n.....\n.....\n.....\n.....\n.....\n\n.....\n.....\n.....\n.....\n.....\n\n.p..\no...\n.*@.\n#..#\n\n)(ea\n.....\n.o#..\n.@#..\n.#*p.\n.....\n\n........\n.####...\n.#.o#...\n.#..###.\n.#@p..#.\n.#..*.#.\n.#..###.\n.####...\n........\n\n\nmessage level 1 of 10\n\n####..\n#.O#..\n#..###\n#@P..#\n#..*.#\n#..###\n####..\n\nmessage level 2 of 10\n\n######\n#....#\n#.#P.#\n#.*@.#\n#.O@.#\n#....#\n######\n\nmessage level 3 of 10\n\n..####...\n###..####\n#.....*.#\n#.#..#*.#\n#.O.O#P.#\n#########\n\nmessage level 4 of 10\n\n########\n#......#\n#.O@@*P#\n#......#\n#####..#\n....####\n\nmessage level 5 of 10\n\n.#######\n.#.....#\n.#.O*O.#\n##.*P*.#\n#..O*O.#\n#......#\n########\n\nmessage level 6 of 10\n\n######.#####\n#....###...#\n#.**.....#P#\n#.*.#OOO...#\n#...########\n#####.......\n\nmessage level 7 of 10\n\n#######\n#.....#\n#.O*O.#\n#.*O*.#\n#.O*O.#\n#.*O*.#\n#..P..#\n#######\n\nmessage level 8 of 10\n\n..######\n..#.OOP#\n..#.**.#\n..##.###\n...#.#..\n...#.#..\n####.#..\n#....##.\n#.#...#.\n#...#.#.\n###...#.\n..#####.\n\nmessage level 9 of 10\n\n#####.\n#O..##\n#P**.#\n##...#\n.##..#\n..##O#\n...###\n\nmessage level 10 of 10\n\n......#####\n......#O..#\n......#O#.#\n#######O#.#\n#.P.*.*.*.#\n#.#.#.#.###\n#.......#..\n#########..\n\nmessage congratulations!\n",["line 127 : Detected a comment where I was expecting a level. Oh gosh; if this is to do with you using '(' as a character in the legend, please don't do that ^^"],1] + ["title Simple Block Pushing Game\nauthor David Skinner\nhomepage www.puzzlescript.net\n\n========\nOBJECTS\n========\n\nBackground\nLIGHTGREEN GREEN\n11111\n01111\n11101\n11111\n10111\n\n\nTarget\nDarkBlue\n.....\n.000.\n.0.0.\n.000.\n.....\n\nWall\nBROWN DARKBROWN\n00010\n11111\n01000\n11111\n00010\n\nPlayer\nBlack Orange White Blue\n.000.\n.111.\n22222\n.333.\n.3.3.\n\nCrate\nOrange\n00000\n0...0\n0...0\n0...0\n00000\n\n\n=======\nLEGEND\n=======\n\n. = Background\n# = Wall\nP = Player\n* = Crate\n@ = Crate and Target\nO = Target\n\nobstacle = crate or wall\n\n=======\nSOUNDS\n=======\n\nCrate MOVE 36772507\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nPlayer, Wall, Crate\nTarget\n\n======\nRULES\n======\n(\n[ > player | crate | obstacle ] -> cancel\n[ > player | wall ] -> cancel\n\n\n[ > Player | Crate | ] -> [ > Player | | Crate ]\n[ wall | > player | ] -> [ wall | wall | player ]\n\n)\n\n[ > player | crate ] -> [ > player | > crate ]\n[ wall | > player ] -> [ > wall | > player ]\n\n==============\nWINCONDITIONS\n==============\n\nAll Target on Crate\n\n=======\nLEVELS\n=======\n\n....\n....\n....\n....\n\n\n.....\n.....\n.....\n.....\n.....\n\n.....\n.....\n.....\n.....\n.....\n\n.p..\no...\n.*@.\n#..#\n\n)(ea\n.....\n.o#..\n.@#..\n.#*p.\n.....\n\n........\n.####...\n.#.o#...\n.#..###.\n.#@p..#.\n.#..*.#.\n.#..###.\n.####...\n........\n\n\nmessage level 1 of 10\n\n####..\n#.O#..\n#..###\n#@P..#\n#..*.#\n#..###\n####..\n\nmessage level 2 of 10\n\n######\n#....#\n#.#P.#\n#.*@.#\n#.O@.#\n#....#\n######\n\nmessage level 3 of 10\n\n..####...\n###..####\n#.....*.#\n#.#..#*.#\n#.O.O#P.#\n#########\n\nmessage level 4 of 10\n\n########\n#......#\n#.O@@*P#\n#......#\n#####..#\n....####\n\nmessage level 5 of 10\n\n.#######\n.#.....#\n.#.O*O.#\n##.*P*.#\n#..O*O.#\n#......#\n########\n\nmessage level 6 of 10\n\n######.#####\n#....###...#\n#.**.....#P#\n#.*.#OOO...#\n#...########\n#####.......\n\nmessage level 7 of 10\n\n#######\n#.....#\n#.O*O.#\n#.*O*.#\n#.O*O.#\n#.*O*.#\n#..P..#\n#######\n\nmessage level 8 of 10\n\n..######\n..#.OOP#\n..#.**.#\n..##.###\n...#.#..\n...#.#..\n####.#..\n#....##.\n#.#...#.\n#...#.#.\n###...#.\n..#####.\n\nmessage level 9 of 10\n\n#####.\n#O..##\n#P**.#\n##...#\n.##..#\n..##O#\n...###\n\nmessage level 10 of 10\n\n......#####\n......#O..#\n......#O#.#\n#######O#.#\n#.P.*.*.*.#\n#.#.#.#.###\n#.......#..\n#########..\n\nmessage congratulations!\n",["line 127 : Key \")\" not found. Do you need to add it to the legend, or define a new object?","line 127 : Error, symbol \")\", used in map, not found."],2] + ], + [ + "Confused mid-line parsing test", + ["OBJECTS Bad\n======= AlsoBad\n(!!!!!) Trouble\nRed\n\nBackground Player .\nBlack\n\nLEGEND\n\nZap = Bad or Player\nBang = AlsoBad or Player\nBoom = Trouble or Player\n\nSOUNDS\n\nCOLLISIONLAYERS\n\nBackground\nTrouble\n\nRULES\n\nWINCONDITIONS\n\nNo Trouble\n\nLEVELS\n\n.\n",["line 1 : Only comments should go after a section name on a line.","line 2 : Only comments should go after an equals decorator ('===') on a line.","line 11 : Cannot reference \"BAD\" in the LEGEND section; it has not been defined yet.","line 12 : Cannot reference \"ALSOBAD\" in the LEGEND section; it has not been defined yet."],4] ], ]; \ No newline at end of file diff --git a/src/tests/resources/testdata.js b/src/tests/resources/testdata.js index 16922f15d..e931ebfd6 100644 --- a/src/tests/resources/testdata.js +++ b/src/tests/resources/testdata.js @@ -266,7 +266,7 @@ var testdata = [ ], [ "ponies", - ["title Ponies Jumping Synchronously\nauthor vytah\n\nbackground_color #990044\ntext_color white\n\n========\nOBJECTS\n========\n\n\nBackground (special, automatically placed in its own layer)\nlightblue\n\nJumpVariableA\nlightblue\n0...0\n.000.\n.0.0.\n.000.\n0...0\n\nJumpVariableA1\nlightblue\n0...0\n..0..\n..0..\n..0..\n0...0\n\nJumpVariableA2\nlightblue\n0...0\n.0.0.\n.0.0.\n.0.0.\n0...0\n\nJumpVariableT\nlightblue\n..0..\n.000.\n.0.0.\n.000.\n.....\n\nJumpVariableT1\nlightblue\n..0..\n..0..\n..0..\n..0..\n.....\n\nJumpVariableT2\nlightblue\n..0..\n.0.0.\n.0.0.\n.0.0.\n.....\n\nJumpVariableB\nlightblue\n.....\n.000.\n.0.0.\n.000.\n..0..\n\nJumpVariableB1\nlightblue\n.....\n..0..\n..0..\n..0..\n..0..\n\nJumpVariableB2\nlightblue\n.....\n.0.0.\n.0.0.\n.0.0.\n..0..\n\nDirt\nbrown darkbrown\n00000\n01000\n00000\n00010\n00000\n\nTunnel\nbrown darkbrown\n00000\n01000\n.....\n.....\n.....\n\n\nGrass\nbrown lightgreen green darkBrown\n11211\n21020\n00000\n00030\n00000\n\nExit\npink red\n.1.1.\n10101\n10001\n.101.\n..1..\n\nWoodenWall\nBrown orange\n.111.\n.001.\n.111.\n.100.\n.111.\n\nTeleport\nBrown darkBrown pink white\n23332\n02220\n00000\n00010\n00000\n\nFire\nred orange yellow\n..0..\n.00..\n0110.\n01210\n.020.\n\nTwiLeft\npurple\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nTwiRight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nTeleportingTwilight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nRdLeft\n#00dddd\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nRdRight\n#00dddd\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nAbLeft\nyellow red\n..1..\n.01..\n00...\n.0000\n.0.0.\n\nAbRight\nyellow red\n..1..\n..10.\n...00\n0000.\n.0.0.\n\nAjLeft\norange\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nAjRight\norange\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nDeadPony\nlightGray darkGray\n.111.\n10001\n10101\n10001\n10101\n\nBoulder\nlightGray darkGray\n.....\n.111.\n10001\n10001\n.111.\n\n=======\nLEGEND\n=======\n\nApplejack=AjLeft or AjRight\nRainbowDash=RdLeft or RdRight\nTwilight=TwiLeft or TwiRight\nAppleBloom=AbLeft or AbRight\n(NotPegasus=Twilight or Applejack or AppleBloom or TeleportingTwilight)\nPlayer=Twilight or Applejack or AppleBloom or RainbowDash\nObstacle=Grass or Dirt or DeadPony or WoodenWall or Teleport or Boulder\nJumpObstacle=Obstacle or Player or Tunnel\nJumpObstacleForFillies=Obstacle or Player\nJumpVariablePositiveA=JumpVariableA1 or JumpVariableA2\nJumpVariablePositiveT=JumpVariableT1 or JumpVariableT2\nJumpVariablePositiveB=JumpVariableB1 or JumpVariableB2\n\n. = Background\n# = Dirt\n~ = Grass\n| = WoodenWall\nT = TwiRight\nA = AjRight\nD = RdRight\nB = AbRight\nJ = JumpVariableA\nH = JumpVariableT\nL = JumpVariableB\nE = Exit\n^ = Teleport\nF = Fire\nO = Boulder\n- = Tunnel\n\n=========\nSOUNDS\n=========\n\nsfx0 47251907 (aj push)\nsfx1 13930501 (twi zap)\nsfx2 99083104 (death)\nsfx3 12667901 (twi teleport)\nsfx4 60310105 (jump)\nsfx5 58764102 (rd smash)\nsfx7 74120302 (aj buck)\nendlevel 64815700\n\n\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nJumpVariableA, JumpVariablePositiveA, JumpVariableT,JumpVariablePositiveT, JumpVariableB, JumpVariablePositiveB\nExit, Fire, Tunnel\nPlayer, Obstacle, TeleportingTwilight\n\n======\nRULES \n====== \n\n[> Player |Stationary Player] -> cancel\n[> Player |< Player] -> cancel\n\n[> Applejack| Tunnel] -> [Applejack|Tunnel]\n[> RainbowDash| Tunnel] -> [RainbowDash|Tunnel]\n[> Twilight| Tunnel] -> [Twilight|Tunnel]\nVertical [> AppleBloom|Tunnel] -> [AppleBloom|Tunnel]\n\n[Left TwiRight] -> [Left TwiLeft]\n[Right TwiLeft] -> [Right TwiRight]\n[Left RdRight] -> [Left RdLeft]\n[Right RdLeft] -> [Right RdRight]\n[Left AjRight] -> [Left AjLeft]\n[Right AjLeft] -> [Right AjRight]\n[Left AbRight] -> [Left AbLeft]\n[Right AbLeft] -> [Right AbRight]\n\nRight[Action Applejack|WoodenWall] -> [AjLeft|]sfx7\nLeft[Action Applejack|WoodenWall] -> [AjRight|]sfx7\n\nDown[Action Twilight|Teleport][no Player|Teleport]-> [|Teleport][TeleportingTwilight|Teleport] sfx3\nlate[TeleportingTwilight]->[TwiRight]\n\n\nUP [ Up Applejack | No Obstacle No Player no tunnel] [JumpVariableA] -> [ Up Applejack | ] [JumpVariableA2] sfx4\nDOWN [ Up Applejack | no obstacle No Player no tunnel ][JumpVariablePositiveA] -> [ Applejack | ][JumpVariablePositiveA]\nDOWN [ Up Applejack | no obstacle No Player no tunnel][JumpVariableA2] -> [ Applejack | ][JumpVariableA2]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA1] -> [ | Applejack ][JumpVariableA]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA2] -> [ | Applejack ][JumpVariableA1]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA1] -> [ Applejack|JumpObstacle ][JumpVariableA]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA2] -> [ Applejack|JumpObstacle ][JumpVariableA1]\nLATE DOWN [ Applejack | NO obstacle No Player no tunnel][JumpVariableA] -> [ | Applejack ][JumpVariableA]\nLATE DOWN [ Applejack | Obstacle ][JumpVariablePositiveA] -> [ Applejack | Obstacle ][JumpVariableA]\n\n\nUP [ Up Twilight | No Obstacle No Player no tunnel] [JumpVariableT] -> [ Up Twilight | ] [JumpVariableT2] sfx4\nDOWN [ Up Twilight | no obstacle No Player no tunnel ][JumpVariablePositiveT] -> [ Twilight | ][JumpVariablePositiveT]\nDOWN [ Up Twilight | no obstacle No Player no tunnel][JumpVariableT2] -> [ Twilight | ][JumpVariableT2]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT1] -> [ | Twilight ][JumpVariableT]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT2] -> [ | Twilight ][JumpVariableT1]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT1] -> [ Twilight|JumpObstacle ][JumpVariableT]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT2] -> [ Twilight|JumpObstacle ][JumpVariableT1]\nLATE DOWN [ Twilight | NO obstacle No Player no tunnel][JumpVariableT] -> [ | Twilight ][JumpVariableT]\nLATE DOWN [ Twilight | Obstacle ][JumpVariablePositiveT] -> [ Twilight | Obstacle ][JumpVariableT]\n\n\nUP [ Up AppleBloom | No Obstacle No Player no tunnel] [JumpVariableB] -> [ Up AppleBloom | ] [JumpVariableB2] sfx4\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel ][JumpVariablePositiveB] -> [ AppleBloom | ][JumpVariablePositiveB]\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel][JumpVariableB2] -> [ AppleBloom | ][JumpVariableB2]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB1][ -> [ | AppleBloom ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB2] -> [ | AppleBloom ][JumpVariableB1]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB1] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB2] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB1]\nLATE DOWN [ AppleBloom | NO obstacle No Player no tunnel][JumpVariableB] -> [ | AppleBloom ][JumpVariableB]\nLATE DOWN [ AppleBloom | Obstacle ][JumpVariablePositiveB] -> [ AppleBloom | Obstacle ][JumpVariableB]\n)\n\nlate [Player Fire] -> [DeadPony Fire] sfx2\n\n[> Applejack|Boulder|no Obstacle No Player] -> [> Applejack| > Boulder |] sfx0\n[> RainbowDash|Boulder|no Obstacle No Player] -> [> RainbowDash||] sfx5\nRight [Action TwiRight|Boulder] -> [TwiRight|] sfx1\nLeft [Action TwiLeft|Boulder] -> [TwiLeft|] sfx1\n\n[Boulder Fire] -> [Boulder]\n\nlate down [Boulder|Player] -> [|DeadPony] sfx2\nlate down [Boulder| no Obstacle no Tunnel] -> [|Boulder no Fire]\nlate [Boulder Fire] -> [Boulder]\n\n==============\nWINCONDITIONS\n==============\n\nsome Player\nall Exit on Player\nno DeadPony\n\n\n======= \nLEVELS\n=======\n\n(message #1. Grab the Crystal Heart.)\n\n..........H\n...........\n.........E.\n..T....~~~~\n~~~~~~#####\n###########\n\n\nmessage #2. Applejack bucks and pushes.\n\n..........J\n..~~~~~~~~~\n...########\n.A.|.o...E#\n######.####\n###########\n\nmessage #3. Twilight teleports and zaps.\n\n...........H\n............\n............\n.T....E.O...\n~^~FFF~~~~^~\n############\n\nmessage #4. Rainbow Dash flies and smashes.\n\n#########\n....#..E#\n....O..##\n....#..##\n.D..#..##\n#########\n\nmessage #5. Rocks fall, everyone dies.\n\n.........J\n..........\n...~~~~~.~\n~~O..O...#\n##|A.O..E#\n##########\n\nmessage #6. Cooperate with friends.\n\nJ.....###\n......###\n...D..#.E\n....#..O#\n.A..O..|#\n~~~######\n#########\n\nmessage #7. Cooperate with family.\n\n##.......JL#####\n---..O.A.O.#...#\n###~.~~~~~.#..E#\n###.F..B..F-.###\n####.#####.#####\n################\n\n\nmessage #8. Help a filly get a cutie mark!\n~~~~~..........L\n#####.........D.\n###E-....O......\n######...O......\n#######.###...B.\n############~~~~\n\nmessage Aww... Still no cutie mark...\n\nmessage #9. Explore dangerous caves!\n\n.........##############\n.......###O############\nJHL..#####O############\n...#######O############\n..#####..-O------O-E###\n######..##O######O#####\n#####..###|...A..O.....\n####..####O###^.#######\n####.-----O-------...B.\n##########O############\n..........O..........T.\n############^##########\n\nmessage #10. Friendship is magic!\n\nJH.........###\n.......O.#.#OE\nDAT....|.#..O#\n~~~.~~~.~###O#\n.......F.#..O#\n########^#^###\n\nmessage #11. Evil enchantress.\n~~~~~...............JHL\n#####~~~~~~~~~~........\n################.......\n###......###...........\n###..O.O.F.....#.#..D..\n#E-..#B#.|O........A.T.\n#############.~~~~~~~~~\n#######################\n\n\nmessage #12. Equestrian Games.\n\n###############################\n#########O#####################\n#########O#####################\n###......O..................JHL\n###..O.#.O..............D......\n#E-..#B#.O.....................\n#########O#####################\n#........|.....................\n#########O#####..|.|.|.|.|.....\n#........O....##.#.#.#.#.#.A...\n############...################\n#############..................\n###############...F........T...\n###############################\n\nmessage Congratulations!\n\nmessage The Mushroom Kingdom is now safe!\n\nmessage I mean, the Crystal Empire.\n",[0,1,1,1,0,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,0,1],"background grass:0,background dirt:1,1,1,1,1,1,1,0,1,1,1,1,background exit:2,1,1,0,1,1,1,1,background tunnel:3,1,\n1,0,1,1,background:4,4,4,1,1,0,1,1,4,4,4,1,1,background rdleft:5,0,1,4,background boulder:6,1,\n1,1,4,0,1,4,ableft background:7,4,1,1,4,0,1,4,6,1,1,1,4,0,1,4,4,\n4,1,1,4,0,1,1,background deadpony fire:8,background woodenwall:9,1,1,4,0,1,1,background twileft:10,6,1,1,4,0,1,1,\n4,4,1,1,4,0,1,4,4,4,1,1,4,0,1,4,4,4,4,1,4,0,1,\n4,4,4,0,1,4,4,1,4,1,4,0,1,4,4,4,4,4,4,0,1,4,4,\n4,4,1,4,0,1,4,4,4,4,4,4,0,1,4,4,4,4,4,4,0,1,background jumpvariablea:11,\n4,4,4,4,4,0,1,background jumpvariablet:12,4,4,4,4,4,0,1,background jumpvariableb1:13,4,4,4,4,4,0,1,\n",21,"1397265987570.09"] + ["title Ponies Jumping Synchronously\nauthor vytah\n\nbackground_color #990044\ntext_color white\n\n========\nOBJECTS\n========\n\n\nBackground (special, automatically placed in its own layer)\nlightblue\n\nJumpVariableA\nlightblue\n0...0\n.000.\n.0.0.\n.000.\n0...0\n\nJumpVariableA1\nlightblue\n0...0\n..0..\n..0..\n..0..\n0...0\n\nJumpVariableA2\nlightblue\n0...0\n.0.0.\n.0.0.\n.0.0.\n0...0\n\nJumpVariableT\nlightblue\n..0..\n.000.\n.0.0.\n.000.\n.....\n\nJumpVariableT1\nlightblue\n..0..\n..0..\n..0..\n..0..\n.....\n\nJumpVariableT2\nlightblue\n..0..\n.0.0.\n.0.0.\n.0.0.\n.....\n\nJumpVariableB\nlightblue\n.....\n.000.\n.0.0.\n.000.\n..0..\n\nJumpVariableB1\nlightblue\n.....\n..0..\n..0..\n..0..\n..0..\n\nJumpVariableB2\nlightblue\n.....\n.0.0.\n.0.0.\n.0.0.\n..0..\n\nDirt\nbrown darkbrown\n00000\n01000\n00000\n00010\n00000\n\nTunnel\nbrown darkbrown\n00000\n01000\n.....\n.....\n.....\n\n\nGrass\nbrown lightgreen green darkBrown\n11211\n21020\n00000\n00030\n00000\n\nExit\npink red\n.1.1.\n10101\n10001\n.101.\n..1..\n\nWoodenWall\nBrown orange\n.111.\n.001.\n.111.\n.100.\n.111.\n\nTeleport\nBrown darkBrown pink white\n23332\n02220\n00000\n00010\n00000\n\nFire\nred orange yellow\n..0..\n.00..\n0110.\n01210\n.020.\n\nTwiLeft\npurple\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nTwiRight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nTeleportingTwilight\npurple\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nRdLeft\n#00dddd\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nRdRight\n#00dddd\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nAbLeft\nyellow red\n..1..\n.01..\n00...\n.0000\n.0.0.\n\nAbRight\nyellow red\n..1..\n..10.\n...00\n0000.\n.0.0.\n\nAjLeft\norange\n.0...\n00...\n.0000\n.0.0.\n.0.0.\n\nAjRight\norange\n...0.\n...00\n0000.\n.0.0.\n.0.0.\n\nDeadPony\nlightGray darkGray\n.111.\n10001\n10101\n10001\n10101\n\nBoulder\nlightGray darkGray\n.....\n.111.\n10001\n10001\n.111.\n\n=======\nLEGEND\n=======\n\nApplejack=AjLeft or AjRight\nRainbowDash=RdLeft or RdRight\nTwilight=TwiLeft or TwiRight\nAppleBloom=AbLeft or AbRight\n(NotPegasus=Twilight or Applejack or AppleBloom or TeleportingTwilight)\nPlayer=Twilight or Applejack or AppleBloom or RainbowDash\nObstacle=Grass or Dirt or DeadPony or WoodenWall or Teleport or Boulder\nJumpObstacle=Obstacle or Player or Tunnel\nJumpObstacleForFillies=Obstacle or Player\nJumpVariablePositiveA=JumpVariableA1 or JumpVariableA2\nJumpVariablePositiveT=JumpVariableT1 or JumpVariableT2\nJumpVariablePositiveB=JumpVariableB1 or JumpVariableB2\n\n. = Background\n# = Dirt\n~ = Grass\n| = WoodenWall\nT = TwiRight\nA = AjRight\nD = RdRight\nB = AbRight\nJ = JumpVariableA\nH = JumpVariableT\nL = JumpVariableB\nE = Exit\n^ = Teleport\nF = Fire\nO = Boulder\n- = Tunnel\n\n=========\nSOUNDS\n=========\n\nsfx0 47251907 (aj push)\nsfx1 13930501 (twi zap)\nsfx2 99083104 (death)\nsfx3 12667901 (twi teleport)\nsfx4 60310105 (jump)\nsfx5 58764102 (rd smash)\nsfx7 74120302 (aj buck)\nendlevel 64815700\n\n\n\n================\nCOLLISIONLAYERS\n================\n\nBackground\nJumpVariableA, JumpVariablePositiveA, JumpVariableT,JumpVariablePositiveT, JumpVariableB, JumpVariablePositiveB\nExit, Fire, Tunnel\nPlayer, Obstacle, TeleportingTwilight\n\n======\nRULES \n====== \n\n[> Player |Stationary Player] -> cancel\n[> Player |< Player] -> cancel\n\n[> Applejack| Tunnel] -> [Applejack|Tunnel]\n[> RainbowDash| Tunnel] -> [RainbowDash|Tunnel]\n[> Twilight| Tunnel] -> [Twilight|Tunnel]\nVertical [> AppleBloom|Tunnel] -> [AppleBloom|Tunnel]\n\n[Left TwiRight] -> [Left TwiLeft]\n[Right TwiLeft] -> [Right TwiRight]\n[Left RdRight] -> [Left RdLeft]\n[Right RdLeft] -> [Right RdRight]\n[Left AjRight] -> [Left AjLeft]\n[Right AjLeft] -> [Right AjRight]\n[Left AbRight] -> [Left AbLeft]\n[Right AbLeft] -> [Right AbRight]\n\nRight[Action Applejack|WoodenWall] -> [AjLeft|]sfx7\nLeft[Action Applejack|WoodenWall] -> [AjRight|]sfx7\n\nDown[Action Twilight|Teleport][no Player|Teleport]-> [|Teleport][TeleportingTwilight|Teleport] sfx3\nlate[TeleportingTwilight]->[TwiRight]\n\n\nUP [ Up Applejack | No Obstacle No Player no tunnel] [JumpVariableA] -> [ Up Applejack | ] [JumpVariableA2] sfx4\nDOWN [ Up Applejack | no obstacle No Player no tunnel ][JumpVariablePositiveA] -> [ Applejack | ][JumpVariablePositiveA]\nDOWN [ Up Applejack | no obstacle No Player no tunnel][JumpVariableA2] -> [ Applejack | ][JumpVariableA2]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA1] -> [ | Applejack ][JumpVariableA]\nHORIZONTAL [ > Applejack | NO obstacle No Player no tunnel][JumpVariableA2] -> [ | Applejack ][JumpVariableA1]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA1] -> [ Applejack|JumpObstacle ][JumpVariableA]\nHORIZONTAL [ > Applejack | JumpObstacle][JumpVariableA2] -> [ Applejack|JumpObstacle ][JumpVariableA1]\nLATE DOWN [ Applejack | NO obstacle No Player no tunnel][JumpVariableA] -> [ | Applejack ][JumpVariableA]\nLATE DOWN [ Applejack | Obstacle ][JumpVariablePositiveA] -> [ Applejack | Obstacle ][JumpVariableA]\n\n\nUP [ Up Twilight | No Obstacle No Player no tunnel] [JumpVariableT] -> [ Up Twilight | ] [JumpVariableT2] sfx4\nDOWN [ Up Twilight | no obstacle No Player no tunnel ][JumpVariablePositiveT] -> [ Twilight | ][JumpVariablePositiveT]\nDOWN [ Up Twilight | no obstacle No Player no tunnel][JumpVariableT2] -> [ Twilight | ][JumpVariableT2]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT1] -> [ | Twilight ][JumpVariableT]\nHORIZONTAL [ > Twilight | NO obstacle No Player no tunnel][JumpVariableT2] -> [ | Twilight ][JumpVariableT1]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT1] -> [ Twilight|JumpObstacle ][JumpVariableT]\nHORIZONTAL [ > Twilight | JumpObstacle][JumpVariableT2] -> [ Twilight|JumpObstacle ][JumpVariableT1]\nLATE DOWN [ Twilight | NO obstacle No Player no tunnel][JumpVariableT] -> [ | Twilight ][JumpVariableT]\nLATE DOWN [ Twilight | Obstacle ][JumpVariablePositiveT] -> [ Twilight | Obstacle ][JumpVariableT]\n\n\nUP [ Up AppleBloom | No Obstacle No Player no tunnel] [JumpVariableB] -> [ Up AppleBloom | ] [JumpVariableB2] sfx4\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel ][JumpVariablePositiveB] -> [ AppleBloom | ][JumpVariablePositiveB]\nDOWN [ Up AppleBloom | no obstacle No Player no tunnel][JumpVariableB2] -> [ AppleBloom | ][JumpVariableB2]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB1][ -> [ | AppleBloom ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | NO obstacle No Player][JumpVariableB2] -> [ | AppleBloom ][JumpVariableB1]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB1] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB]\nHORIZONTAL [ > AppleBloom | JumpObstacleForFillies][JumpVariableB2] -> [ AppleBloom|JumpObstacleForFillies ][JumpVariableB1]\nLATE DOWN [ AppleBloom | NO obstacle No Player no tunnel][JumpVariableB] -> [ | AppleBloom ][JumpVariableB]\nLATE DOWN [ AppleBloom | Obstacle ][JumpVariablePositiveB] -> [ AppleBloom | Obstacle ][JumpVariableB]\n\n\nlate [Player Fire] -> [DeadPony Fire] sfx2\n\n[> Applejack|Boulder|no Obstacle No Player] -> [> Applejack| > Boulder |] sfx0\n[> RainbowDash|Boulder|no Obstacle No Player] -> [> RainbowDash||] sfx5\nRight [Action TwiRight|Boulder] -> [TwiRight|] sfx1\nLeft [Action TwiLeft|Boulder] -> [TwiLeft|] sfx1\n\n[Boulder Fire] -> [Boulder]\n\nlate down [Boulder|Player] -> [|DeadPony] sfx2\nlate down [Boulder| no Obstacle no Tunnel] -> [|Boulder no Fire]\nlate [Boulder Fire] -> [Boulder]\n\n==============\nWINCONDITIONS\n==============\n\nsome Player\nall Exit on Player\nno DeadPony\n\n\n======= \nLEVELS\n=======\n\n(message #1. Grab the Crystal Heart.)\n\n..........H\n...........\n.........E.\n..T....~~~~\n~~~~~~#####\n###########\n\n\nmessage #2. Applejack bucks and pushes.\n\n..........J\n..~~~~~~~~~\n...########\n.A.|.o...E#\n######.####\n###########\n\nmessage #3. Twilight teleports and zaps.\n\n...........H\n............\n............\n.T....E.O...\n~^~FFF~~~~^~\n############\n\nmessage #4. Rainbow Dash flies and smashes.\n\n#########\n....#..E#\n....O..##\n....#..##\n.D..#..##\n#########\n\nmessage #5. Rocks fall, everyone dies.\n\n.........J\n..........\n...~~~~~.~\n~~O..O...#\n##|A.O..E#\n##########\n\nmessage #6. Cooperate with friends.\n\nJ.....###\n......###\n...D..#.E\n....#..O#\n.A..O..|#\n~~~######\n#########\n\nmessage #7. Cooperate with family.\n\n##.......JL#####\n---..O.A.O.#...#\n###~.~~~~~.#..E#\n###.F..B..F-.###\n####.#####.#####\n################\n\n\nmessage #8. Help a filly get a cutie mark!\n~~~~~..........L\n#####.........D.\n###E-....O......\n######...O......\n#######.###...B.\n############~~~~\n\nmessage Aww... Still no cutie mark...\n\nmessage #9. Explore dangerous caves!\n\n.........##############\n.......###O############\nJHL..#####O############\n...#######O############\n..#####..-O------O-E###\n######..##O######O#####\n#####..###|...A..O.....\n####..####O###^.#######\n####.-----O-------...B.\n##########O############\n..........O..........T.\n############^##########\n\nmessage #10. Friendship is magic!\n\nJH.........###\n.......O.#.#OE\nDAT....|.#..O#\n~~~.~~~.~###O#\n.......F.#..O#\n########^#^###\n\nmessage #11. Evil enchantress.\n~~~~~...............JHL\n#####~~~~~~~~~~........\n################.......\n###......###...........\n###..O.O.F.....#.#..D..\n#E-..#B#.|O........A.T.\n#############.~~~~~~~~~\n#######################\n\n\nmessage #12. Equestrian Games.\n\n###############################\n#########O#####################\n#########O#####################\n###......O..................JHL\n###..O.#.O..............D......\n#E-..#B#.O.....................\n#########O#####################\n#........|.....................\n#########O#####..|.|.|.|.|.....\n#........O....##.#.#.#.#.#.A...\n############...################\n#############..................\n###############...F........T...\n###############################\n\nmessage Congratulations!\n\nmessage The Mushroom Kingdom is now safe!\n\nmessage I mean, the Crystal Empire.\n",[0,1,1,1,0,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,1,0,1],"background grass:0,background dirt:1,1,1,1,1,1,1,0,1,1,1,1,background exit:2,1,1,0,1,1,1,1,background tunnel:3,1,\n1,0,1,1,background:4,4,4,1,1,0,1,1,4,4,4,1,1,background rdleft:5,0,1,4,background boulder:6,1,\n1,1,4,0,1,4,ableft background:7,4,1,1,4,0,1,4,6,1,1,1,4,0,1,4,4,\n4,1,1,4,0,1,1,background deadpony fire:8,background woodenwall:9,1,1,4,0,1,1,background twileft:10,6,1,1,4,0,1,1,\n4,4,1,1,4,0,1,4,4,4,1,1,4,0,1,4,4,4,4,1,4,0,1,\n4,4,4,0,1,4,4,1,4,1,4,0,1,4,4,4,4,4,4,0,1,4,4,\n4,4,1,4,0,1,4,4,4,4,4,4,0,1,4,4,4,4,4,4,0,1,background jumpvariablea:11,\n4,4,4,4,4,0,1,background jumpvariablet:12,4,4,4,4,4,0,1,background jumpvariableb1:13,4,4,4,4,4,0,1,\n",21,"1397265987570.09"] ], [ "take heart lass", From ef85f5dc6548f48e922e7ef2f264bb8b5881ed78 Mon Sep 17 00:00:00 2001 From: Ben Small Date: Thu, 3 Feb 2022 15:30:48 -0800 Subject: [PATCH 3/3] Added test for right parenthesis confusion --- src/tests/resources/errormessage_testdata.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/resources/errormessage_testdata.js b/src/tests/resources/errormessage_testdata.js index 000e7d3ff..9348fda34 100644 --- a/src/tests/resources/errormessage_testdata.js +++ b/src/tests/resources/errormessage_testdata.js @@ -455,4 +455,8 @@ var errormessage_testdata = [ "Confused mid-line parsing test", ["OBJECTS Bad\n======= AlsoBad\n(!!!!!) Trouble\nRed\n\nBackground Player .\nBlack\n\nLEGEND\n\nZap = Bad or Player\nBang = AlsoBad or Player\nBoom = Trouble or Player\n\nSOUNDS\n\nCOLLISIONLAYERS\n\nBackground\nTrouble\n\nRULES\n\nWINCONDITIONS\n\nNo Trouble\n\nLEVELS\n\n.\n",["line 1 : Only comments should go after a section name on a line.","line 2 : Only comments should go after an equals decorator ('===') on a line.","line 11 : Cannot reference \"BAD\" in the LEGEND section; it has not been defined yet.","line 12 : Cannot reference \"ALSOBAD\" in the LEGEND section; it has not been defined yet."],4] ], -]; \ No newline at end of file + [ + "Right parenthesis nonsense", + ["OBJECTS\n\nBackground Player .\nBlack\n\nLEGEND\n\nBad = )Player or Player\n\nSOUNDS\nCOLLISIONLAYERS\n\nBackground\n\nRULES\nWINCONDITIONS\nLEVELS\n\n.\n",["line 8 : Something bad's happening in the LEGEND"],1] + ], +];