mysterytony/markx

Scanner cannot parse newline correctly

Closed this issue · 2 comments

Reproduce Step

Input string is a single new line ("\n"):

image

Result:

image

Expected:

NEWFILE
NEWLINE
ENDLINE
NEWLINE
ENDLINE
ENDFILE

@Xadoy Confirm this issue is fixed in #51 pull request by testing the following:

input

"\n\n\n"

output

NEWFILE
NEWLINE
ENDLINE
NEWLINE
ENDLINE
NEWLINE
ENDLINE
NEWLINE
ENDLINE
ENDFILE

input

""

output

NEWFILE
NEWLINE
ENDLINE
ENDFILE

input

"Hello\n\nWorld"

output

NEWFILE
NEWLINE
WORD
ENDLINE
NEWLINE
ENDLINE
NEWLINE
WORD
ENDLINE
ENDFILE

input

"Hello\n\nWorld\n"

output

NEWFILE
NEWLINE
WORD
ENDLINE
NEWLINE
ENDLINE
NEWLINE
WORD
ENDLINE
NEWLINE
ENDLINE
ENDFILE
Xadoy commented

I don't get this, since in my mind there should be x+1 pairs of "NEWLINE ENDLINE", for x "\n". The first two match, though the last two do not
@mysterytony