| 1065 | return &Expr{Identity: m.Text} |
| 1066 | } |
| 1067 | func (m *IdentityNode) FromExpr(e *Expr) error { |
| 1068 | if len(e.Identity) > 0 { |
| 1069 | m.Text = e.Identity |
| 1070 | m.load() |
| 1071 | return nil |
| 1072 | } else if e.Value != "" { |
| 1073 | m.Text = e.Value |
| 1074 | val := strings.ToLower(m.Text) |
| 1075 | if val != "true" && val != "false" { |
| 1076 | return fmt.Errorf("Value identities are either 'true' or 'false' but got %q", m.Text) |
| 1077 | } |
| 1078 | m.load() |
| 1079 | return nil |
| 1080 | } |
| 1081 | return fmt.Errorf("unrecognized identity") |
| 1082 | } |
| 1083 | func (m *IdentityNode) IsBooleanIdentity() bool { |
| 1084 | val := strings.ToLower(m.Text) |
| 1085 | if val == "true" || val == "false" { |