Open macMikey opened 1 year ago
Can you point to an example? I don't think a quoted string would be interchangeable in LCB - there isn't a string literal concept like in LCS with strict compilation turned off.
There are several, and they're easy to find if you are using Atom or ST:
In the bundle, navigate down to the Extensions->widgets folder, and do a "find in folder" for
property "
navbar, for instance has "opaque"
and "tooltip"
header has "theme", "label", "showLabel", and "opaque"
switchButton has "theme" and "hilight"
svgpath has "scaledWidth", "scaledHeight", "flipped", and "angle"
From testing I can infer that any property where the name is also a keyword (i.e. highlight, angle) must be quoted as a property name. If the token is not reserved, then quoting the property identifier is optional.
did you see any regex/expression for the Name: Identifier
anywhere? I have not seen one.
I presumed that's why properties were quoted, but I couldn't find any discussion, so far, anyway.
Yes, at the top of the LCB Language Reference are regex expressions for all tokens. I have not seen any discussion on it either, but tested svgpath by removing the quotes and got errors on the unquoted keywords.
right, but it doesn't include quotes, right?
Identifier: [A-Za-z_][A-Za-z0-9_.]*
Correct, an identifier is not quoted. I can only infer that this is an undocumented workaround to allow properties to exist that are also keywords. The PropertyDefinition
syntax needs to be updated to include the optional quote and the discussion needs to explain when it may be required.
since we're annotating the manual, what do you think would be the best way to do that? If the manual gets updated, any annotations we make will be lost, right?
in the property page I tried to address this, but I didn't modify the manual. you have collaborator privs in the wiki, if you want to take a crack at it.
In the widget course, they seem to quote the property name in just about every case.
i don't see a pattern to them. is there any harm to quoting all of them?