wenyan
wenyan copied to clipboard
Escape quote (「」) in string
In a lot of programming language, we can use backslash to prevent interpreter from interpreting a quote ("
, '
) as the end of string.
I think that wenyan-lang
also need feature like this
For example, if I want to print 問「天地」好在。
, maybe we can use syntax like this 吾有一言。曰「「問\「天地\」好在。」」。書之。
But put backslash straightly seems doesn't fit with the wenyan philosophy :/
If quote notations 「」
inside the string necessarily match up, then they can be directly determined by AST.
The problem comes when quote notations inside the string do not required to be matched up, e.g. print 問「「
, then print 天地
, then print 」」好在。
how about using something like 萬國碼之一萬兩千三百零一
to represent \u300d
, i.e. 」
how about using something like
萬國碼之一萬兩千三百零一
to represent\u300d
, i.e.」
草
@shyoshyo I like your solution! Or perhaps we can wrap String.fromCharCode to do the trick.
how about using something like
萬國碼之一萬兩千三百零一
to represent\u300d
, i.e.」
Is 「二」not better than「兩」?
Before there is a escape syntax, you can do like this:
夫「「「」」」之一。名之曰「左括弧」。
夫「「「」」」之二。名之曰「右括弧」。
夫「左括弧」書之。
夫「右括弧」書之。