I have a file that looks like this:
    
    
    import std/[lexbase, streams]
    
    type
        UpdateParserState = enum
            startState, statePlainText, statePotentialExpansion
        UpdateParser = object of BaseLexer
            curtext: string
            state: UpdateParserState
    
    func open(my: var UpdateParser, input: Stream) =
        ## Opens update parser
        lexbase.open(my, input)
        my.curtext = ""
        my.state = startState
    
    
    Run

Attempting to compile just this results in the following error:
    
    
    expandupdate.nim(10, 6) Error: 'open' can have side effects
    > expandupdate.nim(12, 17) Hint: 'open' calls `.sideEffect` 'open'
    >> .../nim/lib/pure/lexbase.nim(137, 6) Hint: 'open' called by 'open'
    
    
    Run

What am I doing wrong compared to the parsers in the standard library?

Reply via email to