Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

followup now that https://github.com/nim-lang/Nim/issues/15511 was fixed #103

Merged
merged 4 commits into from
Mar 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
avoid warning: IndexError is deprecated
  • Loading branch information
timotheecour committed Feb 25, 2021
commit b1f796e8b1bdd96482bff0318f58dde46a830c56
6 changes: 5 additions & 1 deletion src/regex/nfa.nim
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ func teClosure(
for s in eNfa.s[state].next:
teClosure(result, eNfa, s, processing, zclosure)

when (NimMajor, NimMinor, NimPatch) < (1,4,0) and not declared(IndexDefect):
# avoids a warning
type IndexDefect = IndexError

func eRemoval*(eNfa: Enfa): Nfa {.raises: [].} =
## Remove e-transitions and return
## remaining state transtions and
Expand Down Expand Up @@ -220,7 +224,7 @@ func eRemoval*(eNfa: Enfa): Nfa {.raises: [].} =
while qw.len > 0:
try:
qa = qw.popLast()
except IndexError:
except IndexDefect:
doAssert false
closure.setLen 0
teClosure(closure, eNfa, qa, processing)
Expand Down