-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Welcome to the AutomatedPuzzleScript wiki!
WHY BETTER: In the JS implementation, everything is done in a single pass: parsing, checking and compiling. This creates a gigantic code base which is unable to do anything efficiently since it only has access to the current line and everything before, where as the rascal implementation first implodes everything into data types that can be manipulated before checking. Section order is also forced in the JS implementation
WHY WORSE: Manual parsing allows for relevant error messages all the way, a helpful but tedious process, the rascal implentation simply throws a ParseError without more info. To some extend this is alleviated by creating very lax syntax rules and then double checking in post. This is still an issue, the grammar can only be SO felxible before in becomes ambigious (see Sprite Length Case).
Things are checked in the sequential order in which they appear below, this is necessary as some errors only happens if a specific set of things is missing from MULTIPLE sections.
Philosophy: If we run into an error, we keep checking other issues anyways even if it makes the game unplayable. We assume that the game is unplayable even if there is a single error, so accidentally causing a few more to provide a more thorough check won't make that much difference.
WHY BETTER: In the JS implementation, many errors have to be checked for multiple times
- ERROR - Duplicate sections: Section is defined more than once
- WARN - Section Missing: A section is missing
- ERROR - Invalid Palette: Color palette not found
- ERROR - Invalid Color: Keyword expected color argument
-
ERROR - Duplicate Legend
-
ERROR - Duplicate Object: Duplicate object name
-
ERROR - Invalid Color: Color not found in color palette
-
ERROR - Invalid Sprite Length: Sprite length not exactly 5 pixels
-
ERROR - Invalid Color Index: Index references color not defined
-
ERROR - Too Many Colors: Sprite cannot have more than 10 colors
-
WARN - Unused Color: Color defined not used in sprite
-
ERROR - Duplicate Legend: Happens when the user tries to define a legend that already exists
-
ERROR - Invalid Legend: Happens when the users uses a mix of 'and' and 'or' in the legend definition
-
ERROR - Undefined Object: Happens when the user references an object that doesn't exist in the legend values
-
ERROR - No Player: No object named player detected (only happens if it is also not defined in OBJECT)
-
ERROR - Invalid Reference: Happens when a user attempts to use a reference that cannot be used in this type of legend (such as aggregate in combined or vice versa)
-
WARN - Self Definition: A legend has the same name as the object it defines
-
ERROR - Undefined Object: Object (or reference) in layer is not defined
-
ERROR - Aggregate Object: Object is an aggregate and cannot be used in a layer
-
ERROR - Unused Object: Object not used in layer
-
ERROR - Aggregate Background: Background cannot not be made up of an combined object
-
WARN - Duplicate in Layer: Object defined in multiple layers
- WARN - No Conditions: No conditions have been defined
-
ERROR - Invalid Level Length: All lines of the level must be the same length
-
ERROR - Undefined Object: Object (or reference) in level not defined
-
ERORR - Ambiguous Definition: Legend defined with 'or' cannot appear in Level
-
ERROR - Undefined Legend: Legend used in level not defined
-
WARN - No Levels: No levels defined
-
WARN - Message Too Long: Message too long to fit on screen