mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #5824 from BradLewis/fix/parser-end-pos-multiline-string
Correct parser end_pos for multiline strings
This commit is contained in:
@@ -99,10 +99,8 @@ end_pos :: proc(tok: tokenizer.Token) -> tokenizer.Pos {
|
|||||||
pos := tok.pos
|
pos := tok.pos
|
||||||
pos.offset += len(tok.text)
|
pos.offset += len(tok.text)
|
||||||
|
|
||||||
if tok.kind == .Comment {
|
if tok.kind == .Comment || tok.kind == .String {
|
||||||
if tok.text[:2] != "/*" {
|
if tok.text[:2] == "/*" || tok.text[:1] == "`" {
|
||||||
pos.column += len(tok.text)
|
|
||||||
} else {
|
|
||||||
for i := 0; i < len(tok.text); i += 1 {
|
for i := 0; i < len(tok.text); i += 1 {
|
||||||
c := tok.text[i]
|
c := tok.text[i]
|
||||||
if c == '\n' {
|
if c == '\n' {
|
||||||
@@ -112,6 +110,8 @@ end_pos :: proc(tok: tokenizer.Token) -> tokenizer.Pos {
|
|||||||
pos.column += 1
|
pos.column += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
pos.column += len(tok.text)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pos.column += len(tok.text)
|
pos.column += len(tok.text)
|
||||||
|
|||||||
Reference in New Issue
Block a user