Skip to content

Commit

Permalink
X2
Browse files Browse the repository at this point in the history
also another spot to put a more descriptive error.
  • Loading branch information
wjg999 committed Aug 26, 2020
1 parent 27a69ef commit 189fbca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Randomizer/Logic/DirectiveParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public LogicDefine ParseAdditionDirective(string[] directiveParts)
throw new ParserException("!addition resulted in a value higher than 255 (0xFF)");
}
}
return new LogicDefine( directiveParts[1] ,totalValue.ToString("X2"));
return new LogicDefine( directiveParts[1] ,totalValue.ToString());
}

public void ParseSetTypeDirective(string[] directiveParts)
Expand Down
9 changes: 8 additions & 1 deletion Randomizer/Logic/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,14 @@ public List<Location> ParseLocations(string[] lines, Random rng)
// Parse the string as a directive, ignoring preparsed directives
if (!SubParser.ParseOnLoad(locationString))
{
SubParser.ParseDirective(locationString);
try
{
SubParser.ParseDirective(locationString);
}
catch(ParserException error)
{
throw new ParserException($"Error at directive \"{locationString}\": {error.Message}");
}
}

}
Expand Down

0 comments on commit 189fbca

Please sign in to comment.