Repository navigation
fix: load-phase errors get their own class; parse errors trim the expected-set (G9) - #853
Merged
Merged
Conversation
…ected-set (G9)
Two usability/clarification fixes from the WO18 parity audit:
- py: expander-phase failures (use cycles, unknown rulesets, unknown
dependency aliases, a non-rule target asked to join a pass) were
routed through IscParseError - semantic failures misreported under
the parse class. New IscLoadError (MapFormatError sibling, same
position triad); the _Expander raises it; the genuine parse scanner
keeps IscParseError. rs/ruby raise MapLogicError for the same
failures.
- ruby: parsanol's expected-set dumps could run to hundreds of
characters ("expected one of [20 items...]"). ParseError now trims
the list to the first 6 alternatives plus "(+N more)", keeping the
position - the compact line:col shape rs/ts/py already give.
TDD: py load pins moved to IscLoadError (collection-error red ->
suite exit 0); ruby trim spec red (full dump) -> green; rake 430/0/11.
Comment on lines
+83
to
+90
| message.sub(/expected one of \[([^\]]*)\]/) do | ||
| items = Regexp.last_match(1).split(", ") | ||
| if items.length > MAX_EXPECTED | ||
| "expected one of [#{items.first(MAX_EXPECTED).join(", ")} …(+#{items.length - MAX_EXPECTED} more)]" | ||
| else | ||
| Regexp.last_match(0) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WO18 audit gap G9 - same semantic failure, four error surfaces. Two fixes:
py - new
IscLoadError: expander-phase failures (use cycles, unknown rulesets, unknown dependency aliases/resolvers, a non-rule target asked to join a pass) were raised asIscParseError, misreporting semantic failures under the parse class.IscLoadErroris now aMapFormatErrorsibling carrying the same position triad;_Expanderraises it and the genuine parse scanner keepsIscParseError. rs/ruby raise theirMapLogicErrorfor the same failures - classification now matches across runtimes.ruby - trimmed parse messages: parsanol's expected-set dumps ran to hundreds of characters.
ParseErrorkeeps the position and the first 6 alternatives, appending(+N more)- the compact shape rs/ts/py already produce.TDD: py load pins moved to
IscLoadError(red at collection, suite exit 0 after); ruby trim spec red (full dump) then green; rake 430 examples / 0 failures / 11 pending; standardrb clean.