achesak/nim-robotparser

createParser() missing

greencardamom opened this issue · 3 comments

I'm trying to read a robots,txt from a local file - Following the example in the comment for the parse() function it doesn't work - the function createParser() is missing and when substituting with createRobotsParser() it returns a blank and throws a 'SIGSEGV: Illegal storage access. (Attempt to read from nil?)' when executing parse()

Even the basic Google robots.txt example doesn't work giving the same 'Illegal storage access' error. Perhaps some breaking change due to Nim I'm using the latest is 0.18 .. I can't figure out why though.

Found the problem. Nim has changed how it handles procs that return a void. There are 4 functions that need updating here is an example.

Old:

proc modified*(robot : RobotParser): =

New:

proc modified*(robot : RobotParser): void {.discardable.} =

Likewise the section at the beginning that defines the functions would change to reflect the void type and discardable

Fixed now. Apologies for the delay on that. Nim's a great language, but the design changes will lead to things I don't use and maintain frequently breaking rather often.