Wiki

Ticket #64: ticket64.patch

File ticket64.patch, 1.2 KB (added by eric.sellon, 15 years ago)
  • Source/Parser.cobra

     
    226226    def _warning(msg as String) 
    227227        _warning(.last, msg) 
    228228 
    229     def _warning(token as IToken, msg as String) 
     229    def _warning(token as IToken?, msg as String) 
    230230        _warningRecorder.warning(CobraWarning(_fileName, token, msg)) 
    231231 
    232232    # TODO: do this with a callback/delegate instead of this bullshit Java-style interface technique 
  • Source/CobraParser.cobra

     
    4040        p.globalNS = NameSpace(Token.empty, '(global)') 
    4141        p.typeProvider = BasicTypeProvider() 
    4242        p.parseSource('test2', 'class Test\n\tdef main is shared\n\t\treturn\n') 
     43         
     44        c = Compiler() 
     45        p = CobraParser(typeProvider=c, warningRecorder=c, errorRecorder=c, globalNS=c.globalNS) 
     46        p.parseSource('test3', '') 
     47         
     48        c = Compiler() 
     49        p = CobraParser(typeProvider=c, warningRecorder=c, errorRecorder=c, globalNS=c.globalNS) 
     50        p.parseSource('test4', '    ') 
    4351 
    4452    shared 
    4553