maxitg / SetReplace

C++/Wolfram Language package for exploring set and graph rewriting systems
MIT License
219 stars 44 forks source link

Adding "OptionNames" in SyntaxInformation to all exposed symbols #592

Closed daneelsan closed 3 years ago

daneelsan commented 3 years ago

Changes

Comments:

Examples

In[] := SetReplace[{{1, 2, 3}}, {{{1, 2, 3}} -> {4}}, 1,  "InvalidOption" -> "test"]

image


This change is Reviewable

daneelsan commented 3 years ago

I added this code to the hasNoSyntaxInformationQ function in meta.wlt:

And[
            Options[Unevaluated @ symbol] =!= {},
            MissingQ[Lookup[SyntaxInformation[Unevaluated @ symbol], "OptionNames"]]]

to error if the exposed symbols has Options but no "OptionNames". However, it doesn't seem to work, it doesn't error out if I remove the "OptionNames" from a symbol...

maxitg commented 3 years ago

@daneelsan, are you sure it doesn't work? On current master (67113af57fb2d158e515221af7ffb9e7daa24c56):

In[] := MissingQ[Lookup[SyntaxInformation[#], "OptionNames"]] & /@ {WolframModel, HypergraphPlot}
Out[] = {True, False}