You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it seems there is a difference between the "raw" and "parse" tag syntax? The following repro shows what I stumbled upon.
package tagsyntax
import (
"testing""github.com/alecthomas/assert/v2""github.com/alecthomas/participle/v2"
)
typeGoodASTstruct {
Keystring`parser:"@Ident '='"`BlankLines []string`"\n"`
}
typeBadASTstruct {
Keystring`parser:"@Ident '='"`// Same as field in GoodAST, as explained in https://github.com/alecthomas/participle#tag-syntaxBlankLines []string`parser:"'\n'"`
}
funcTestLiteralNotTerminatedGood(t*testing.T) {
_, err:=participle.Build(&GoodAST{})
assert.NoError(t, err)
}
funcTestLiteralNotTerminatedBad(t*testing.T) {
_, err:=participle.Build(&BadAST{})
// The error is://// Key: <input>:1:2: literal not terminated//// which is confusing because it refers to the previous field in the struct (Key)// and unclear?assert.NoError(t, err)
}
The text was updated successfully, but these errors were encountered:
Hello,
it seems there is a difference between the "raw" and "parse" tag syntax? The following repro shows what I stumbled upon.
The text was updated successfully, but these errors were encountered: