SubsetMacro indicates whether the macro function should be included in the library subset.
(macroFunction string)
| 623 | |
| 624 | // SubsetMacro indicates whether the macro function should be included in the library subset. |
| 625 | func (lib *LibrarySubset) SubsetMacro(macroFunction string) bool { |
| 626 | // When lib is null, it should indicate that all values are included in the subset. |
| 627 | if lib == nil { |
| 628 | return true |
| 629 | } |
| 630 | if lib.Disabled || lib.DisableMacros { |
| 631 | return false |
| 632 | } |
| 633 | if len(lib.IncludeMacros) != 0 { |
| 634 | for _, name := range lib.IncludeMacros { |
| 635 | if name == macroFunction { |
| 636 | return true |
| 637 | } |
| 638 | } |
| 639 | return false |
| 640 | } |
| 641 | if len(lib.ExcludeMacros) != 0 { |
| 642 | for _, name := range lib.ExcludeMacros { |
| 643 | if name == macroFunction { |
| 644 | return false |
| 645 | } |
| 646 | } |
| 647 | return true |
| 648 | } |
| 649 | return true |
| 650 | } |
| 651 | |
| 652 | // SetDisabled disables or enables the library. |
| 653 | func (lib *LibrarySubset) SetDisabled(value bool) *LibrarySubset { |
no outgoing calls