Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the intended mechanism to deal with quote characters in values? #40

Open
gouttegd opened this issue Jun 18, 2023 · 0 comments
Open

Comments

@gouttegd
Copy link

The textual representation of KGCL needs a way to cope with the possibility that a textual value associated with a change (e.g., the old or new value of a label, definition, synonym, etc.) may contain quote characters.

There are several possible options:

  • C-style escape sequences, e.g., create related synonym 'poor man\'s synonym' for EX:0001;
  • alternating between single- and double-quotes as needed (use single-quotes if the value contains a double-quote and vice-versa) – this does not allow a value to contain both single- and double-quotes simultaneously;
  • Python-style triple-quoting, e.g. create related synonym '''poor man's synonym''' for EX:0001.

Currently, the Python implementation of KGCL seems to opt for triple-quoting when rendering, but the Lark grammar does not allow that for most literal values: synonyms, labels, and definitions are all ultimately expected to be SINGLE_QUOTE_LITERAL, i.e. can only be enclosed in '...'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant