Skip to content

Commit

Permalink
fix: embed parsing now handles double quote rune
Browse files Browse the repository at this point in the history
  • Loading branch information
andyscott committed Nov 15, 2023
1 parent 5c4056d commit 2f722a0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions go/tools/builders/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,28 @@ func (r *importReader) findEmbed(first bool) bool {
case ' ', '\t':
// leave startLine alone

case '\'':
startLine = false
for r.err == nil {
if r.eof {
r.syntaxError()
}
c = r.readByteNoBuf()
if c == '\\' {
r.readByteNoBuf()
if r.err != nil {
r.syntaxError()
return false
}
continue
}
if c == '\'' {
c = r.readByteNoBuf()
goto Reswitch
}
}
goto Reswitch

case '"':
startLine = false
for r.err == nil {
Expand Down

0 comments on commit 2f722a0

Please sign in to comment.