If there is an unauthorized token in the code, at what stage does the syntax error related to the unauthorized token occur and the program stops? lexing or parsing?
In some articles it is written that because the job of the lexer is to separate the permissible and meaningful tokens of the language. At this point it gives an error and the program stops.
Elsewhere it is written that a unauthorized token is considered unknown and is transferred to the next stage of decomposition and gives an error.
Is not the job of the lexer to separate meaningful tokens?
So how do you recognize and create a token that makes no sense?
5 $ 4
5 = number
4 = number
In addition, in the principles of compiler design, we have three types of errors: lexer error, parser error and semantic error. But in Python I do not know if this is the case or not because it was different in some parts @burlachenkok
queue = await curio.submission_queue() queue.submit(CurrentTask()) queue.submit(WriteFile(file, data)) wrote = None while (result := queue.pop_nowait()): match result: case CurrentTask(current_task): ... case WriteFile(wrote) if wrote is None: result = await queue.pop()