Raising SyntaxError inside a Python-based parser

前端 未结 2 846
梦毁少年i
梦毁少年i 2021-01-25 16:32

I\'m writing a Python-based parser that can understand some configuration files that we use. The files will basically consist of (name, type) and (name, value) pairs:

Pa

2条回答
  •  心在旅途
    2021-01-25 16:41

    using SyntaxError might be confusing. Either I'd create some special exception type called eg. ParseError or ignore given value and just log in as a warning

提交回复
热议问题