-
Notifications
You must be signed in to change notification settings - Fork 0
/
syntax_test_dnapy.py.dna
120 lines (95 loc) · 2.6 KB
/
syntax_test_dnapy.py.dna
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# SYNTAX TEST "Packages/Ribosome/Ribosome-Python.sublime-syntax"
import antigravity
#^^^^^^^^^^^^^^^^^ source.python
#<-source.python
for i in range(3):
#^^^^^^^^^^^^^^^^^^ source.python
. Indented text!
# <- meta.preprocessor.dna
#^^^^^^^^^^^^^^^^^^ string.dna
.Indented dot!
# ^ meta.preprocessor.dna
# ^^^^^^^^^^^^^ string.dna
./!output("temporary.txt")
# <- meta.preprocessor.dna
# ^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.dna
# ^ punctuation.definition.arguments.begin.dna
# ^^^^^^^^^^^^^^^^^ source.python
# ^ punctuation.definition.arguments.end.dna
#^ punctuation.definition.keyword.dna
# ^^^^^^^ keyword.operator.word.dna
.Saved to temporary.txt
./!stdout()
# ^^^^^^^^^ meta.function-call.dna
# ^^ source.python
# ^ punctuation.definition.arguments.begin.dna
# ^ punctuation.definition.arguments.end.dna
# ^^^^^^^ keyword.operator.word.dna
./!stdout
# ^^^^^^^ keyword.operator.word.dna
# ^^^^^^^ meta.function-call.dna
.Back to stdout (no parens is fine too)
# <- meta.preprocessor.dna
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.dna
./!append("temporary.txt")
# ^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.dna
# ^^^^^^^ keyword.operator.word.dna
./!output ( "spaces are okay.txt" )
# ^^^^^^^ keyword.operator.word.dna
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.dna
# ^^^^^^^^^^^^^^^^^^^^^^^^^^ source.python
./!output "spaces are still okay.txt"
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.dna
# ^^^^^^^ keyword.operator.word.dna
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.python
.Also, still a string
# <- meta.preprocessor.dna
#^^^^^^^^^^^^^^^^^^^^ string.dna
. /!stdout()
# ^ punctuation.definition.keyword.dna
# ^^^^^^^ keyword.operator.word.dna
#^^^^ meta.preprocessor.dna
# <- meta.preprocessor.dna
. Preceding whitespace
name = "foo"
./!output(name + ".txt")
./!output("test.txt")
.This line goes to the file!
./!stdout()
.This line goes to the console!
./!output("test.txt")
.Stuff
./!stdout()
./!append("test.txt")
.More stuff
def greet(name):
.printf ("Hello, @{name}!\n");
.int main () {
. @{greet("Alice")}
. @{greet("Bob")}
. return 0;
.}
.Hello $
for i in ["Alice", "Bob", "Carol"]:
./+@{i} $
./+!
.Hello $
./!separate(", ")
for i in ["Alice", "Bob", "Carol"]:
. /+@{i}
./+!
s = " 2 "
.1@{s}3
.1&{s}3
.name = "Alice"
..Hello, @1{name}!
.123@{at}{456
. Hello,
./=world!
./!tabsize(4)
# ^^^^^^^^ keyword.operator.word.dna
.for (i = 0; i != 10; ++i)
. printf("Hi!\n");
.}
./!include("foo.dna")
# ^^^^^^^^ keyword.operator.word.dna keyword.control.import.dna