Compiler icon indicating copy to clipboard operation
Compiler copied to clipboard

Incorrect calculation of line and position in utf-8 files

Open SerafimArts opened this issue 8 years ago β€’ 2 comments

Example code with an error on the last line:

type A {
    some(arg: String = "😺 😸 😹 😻 😼 😽 πŸ™€ 😿 😾"): Any
}

😿

Expected (line 5 and column 1):

Unrecognized token "😿" at line 5 and column 1:
😿
↑ <- arrow here

Actual (line 1 and column 89):

Unrecognized token "😿" at line 1 and column 89:
type A {
    some(arg: String = "😺 😸 😹 😻 😼 😽 πŸ™€ 😿 😾"): Any
}

😿some

                                                             ↑ <- arrow here

SerafimArts avatar Nov 01 '17 16:11 SerafimArts

@SerafimArts i might take a look at this bug, but please make it easy for me and provide runnable test code (i don't need a full hoa Test case).

It would be good to fix this bug together with #97 at the same time.

flip111 avatar Jan 25 '19 15:01 flip111

Just write any character from the UTF 4bytes group to reproduce the problem.

grammar:

%skip space \s

text:

    
  
          😺 😸 😹 😻 😼 😽 πŸ™€ 😿 😾 
 

SerafimArts avatar Jan 25 '19 15:01 SerafimArts