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 23240d0 commit 4914d1f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion 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 All @@ -206,7 +228,7 @@ func (r *importReader) findEmbed(first bool) bool {
}
c = r.readByteNoBuf()
if c == '\\' {
r.readByteNoBuf()
_ = r.readByteNoBuf()
if r.err != nil {
r.syntaxError()
return false
Expand Down

0 comments on commit 4914d1f

Please sign in to comment.