File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3393,6 +3393,10 @@ def test_invalid_line_continuation_error_position(self):
33933393 self ._check_error ('\n fgdfgf\n 1,\\ #\n 2\n ' ,
33943394 "unexpected character after line continuation character" ,
33953395 lineno = 3 , offset = 4 )
3396+ for prefix in ("f" , "t" ):
3397+ self ._check_error (f'{ prefix } """{{\n \\ x}}"""' ,
3398+ "unexpected character after line continuation character" ,
3399+ lineno = 2 , offset = 2 )
33963400
33973401 def test_invalid_line_continuation_left_recursive (self ):
33983402 # Check bpo-42218: SyntaxErrors following left-recursive rules
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ _Pypegen_tokenizer_error(Parser *p)
6363 msg = "too many levels of indentation" ;
6464 break ;
6565 case E_LINECONT : {
66- col_offset = p -> tok -> cur - p -> tok -> buf - 1 ;
66+ col_offset = p -> tok -> cur - p -> tok -> line_start - 1 ;
6767 msg = "unexpected character after line continuation character" ;
6868 break ;
6969 }
You can’t perform that action at this time.
0 commit comments