3 ms·
Does this support fancy symbols in bare identifiers? Even the huge reference page is blank on that, and the only working links to grammar are to the ANTLR websi
by eviks 3y ago
Does this support fancy symbols in bare identifiers? Even the huge reference page is blank on that, and the only working links to grammar are to the ANTLR website, but even if they did work, the grammar is also blank as it simply references an internal grammar function
And there doesn't seem to be any online playground to test
- jen20 3y agoYes: quoted identifiers are represented using backticks (which do not then form part of the name), so: local `My Variable` = 42 Do you happen to have a link to the missing/blank reference page on this? EDIT: perhaps I misunderstood the question - if it's about whether you can use non-ASCII characters in identifiers without quoting, the answer is "sometimes": ``` local `abde` = 42 // Only works when quoted local `teʝ` = 42 // Works fine (as expected) local teʝ2 = 42. // Also works fine ``` It might be interesting to expand the docs to cover the precise rules here without having to resort to ANTLR grammar, as you say.
- eviks 3y agoYes, I meant bare unquoted identifiers For example, does x² = 42 work? Or move↓?=true or some emoji I guess not given your first example (though it's not rendered here properly, looks like 4 ascii letters), which is rather unfortunate as configs could be more readable with symbolic names, https://pkl-lang.org/main/current/language-reference/index.html#grammar-definition https://pkl-lang.org/main/current/language-reference/index.h..., both links are broken. Another thing is that the doc page should have an additional pages with a single section/page view otherwise it's too hard to find a word in a single huge doc