mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
support [\n ...] and {\n ...}
This commit is contained in:
parent
7d01af7b90
commit
a1b3347e5b
@ -1,4 +1,8 @@
|
||||
d = {'a':1, 'b':2, 'c':'test'}
|
||||
d = {
|
||||
'a': 1,
|
||||
'b': 2,
|
||||
'c': 'test'
|
||||
}
|
||||
print(d)
|
||||
for item in d:
|
||||
print(item)
|
||||
@ -7,5 +11,8 @@ for k in keys:
|
||||
print(k)
|
||||
print(keys)
|
||||
|
||||
dd = {'list':[1,2,3], 'len':3}
|
||||
dd = {
|
||||
'list': [1, 2, 3],
|
||||
'len': 3
|
||||
}
|
||||
print(dd)
|
||||
|
@ -1,4 +1,8 @@
|
||||
f = open('test/out/file3.txt', 'w')
|
||||
seq = ['This is the first line.\n', 'This is the second line.\n', 'This is the third line.\n']
|
||||
seq = [
|
||||
'This is the first line.\n',
|
||||
'This is the second line.\n',
|
||||
'This is the third line.\n'
|
||||
]
|
||||
f.writelines(seq)
|
||||
f.close()
|
||||
|
2
port/linux/.vscode/launch.json
vendored
2
port/linux/.vscode/launch.json
vendored
@ -11,7 +11,7 @@
|
||||
"program": "${workspaceFolder}/build/test/pikascript_test",
|
||||
// "program": "${workspaceFolder}/build/boot/demo06-pikamain/pikascript_demo06-pikamain",
|
||||
"args": [
|
||||
"--gtest_filter=pikaMain.synac_err_1"
|
||||
// "--gtest_filter=pikaMain.synac_err_1"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
|
@ -846,6 +846,12 @@ void Cursor_iterStart(struct Cursor* ps) {
|
||||
if (strEqu(ps->token1.pyload, "]")) {
|
||||
ps->branket_deepth--;
|
||||
}
|
||||
if (strEqu(ps->token1.pyload, "{")) {
|
||||
ps->branket_deepth++;
|
||||
}
|
||||
if (strEqu(ps->token1.pyload, "}")) {
|
||||
ps->branket_deepth--;
|
||||
}
|
||||
}
|
||||
|
||||
void LexToken_init(struct LexToken* lt) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user