influxdata / influxdata/kapacitor
Consider forbidding multiline single quoted string literals in TICKscript
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
First, thank you for providing quite simple language and EBNF definition as it really helps developing IDE plugins.
I'd like to ask you to change string literals started with prime symbol (`'`) behaviour to not allowing EOLs in them, to make them single line only.
Like in Python, `'` strings would be single line, `'''` strings would be multiline.
From IDE point of view, allowing string literals to be multiline could lead to some huge reparses. Multiline string is like non-terminated '/*' comment in other languages: it's hard to detect where it started and where it should have ended.
In current solution once user typed `'` everything until next `'` would be lexed as string, and same for next quote and so on, so almost all document would be relexed and reparsed. It's not only bad for IDE but for users too as it's hard to see where problem started.
I understand that it's breaking change, though it could be really helpful for some people.
PS: Another misleading language design is double quotes for tag/field reference, people confuse strings with references, however highlighting them in different colors helps.
Contributor guide
Research direction
The issue names no files or tests; start by locating the TICKscript lexer/parser and its EBNF definition. Check how single-quoted and triple-quoted literals are currently recognized, then add coverage showing that single-quoted literals reject EOLs while triple-quoted literals remain multiline.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100