Skip to content

Commit

Permalink
symb: update evaluation of valueless markup attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
GraphR00t committed May 1, 2024
1 parent e37dfe9 commit d87377e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions internal/core/symbolic/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -6023,8 +6023,9 @@ func evalMarkupElement(n *parse.MarkupElement, state *State, options evalOptions
regularAttr, ok := attr.(*parse.MarkupAttribute)
if ok {
name := regularAttr.Name.(*parse.IdentifierLiteral).Name
if regularAttr.Value == nil {
attrs[name] = ANY_STRING
if regularAttr.Value == nil { //no value
//See ../markup.go and the evaluation of *parse.MarkupElement in ../tree_walk_eval.go.
attrs[name] = EMPTY_STRING
continue
}
val, err := symbolicEval(regularAttr.Value, state)
Expand Down
2 changes: 1 addition & 1 deletion internal/core/symbolic/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14578,7 +14578,7 @@ func TestSymbolicEval(t *testing.T) {
assert.Empty(t, state.errors())
assert.Equal(t, &NonInterpretedMarkupElement{
name: "div",
attributes: map[string]Value{"a": ANY_STRING},
attributes: map[string]Value{"a": EMPTY_STRING},
children: []Value{ANY_STRING},
sourceNode: parse.FindNode(n, (*parse.MarkupElement)(nil), nil),
}, res)
Expand Down

0 comments on commit d87377e

Please sign in to comment.