-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
__init__.py
36 lines (30 loc) · 1.2 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
This directory holds language definitions.
Language definitions hold expressions that help defining specific syntax
elements for a programming language.
Currently defined keys are:
names
extensions
comment_delimiters
multiline_comment_delimiters
string_delimiters
multiline_string_delimiters
keywords
special_chars
string_delimiter_escape
max_line_length
When using quoting, if one wishes to represent the delimiter itself
in a string literal, one runs into the problem of `delimiter collision`.
For example, one cannot simply represent a statement like
`"This is "in quotes", but invalid."`.
In some languages, you can use `escape sequences` like
`"This is \"in quotes\" and properly escaped."` and in some others,
`doubling up` like `"This is ""in quotes"" and properly escaped."`
is used but there are many other solutions, depending mainly
on the language preference. All these result in the same thing
that is escaping of the quotation marks or the delimiters,
so these are collectively known as `string_delimiter_escape`.
More information regarding delimiter collision and
escaping delimiter solutions can be found here at
https://en.wikipedia.org/wiki/String_literal#Delimiter_collision.
"""