File tree Expand file tree Collapse file tree 5 files changed +52
-0
lines changed Expand file tree Collapse file tree 5 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -808,6 +808,7 @@ std::string token2text(const int token)
808
808
809
809
T (TK_STRING, " string" )
810
810
T (TK_COMMENT, " comment" )
811
+ T (TK_EOLCOMMENT, " eolcomment" )
811
812
T (TK_LABEL, " label" )
812
813
813
814
T (TK_DBL_DOT, " .." )
Original file line number Diff line number Diff line change
1
+ {
2
+ "basename" : " cpp-comment1-2f8ab90" ,
3
+ "cmd" : " lpython --no-color --show-tokens {infile} -o {outfile}" ,
4
+ "infile" : " tests/tokens/comment1.py" ,
5
+ "infile_hash" : " 27258459bf39e8c5bcaa41e7fef8a593775a915273787edc46c73b4d" ,
6
+ "outfile" : null ,
7
+ "outfile_hash" : null ,
8
+ "stdout" : " cpp-comment1-2f8ab90.stdout" ,
9
+ "stdout_hash" : " da6cd47ba8ae6f208980f8e2b43c6b8eea0ccacf90b54fde79d3e55e" ,
10
+ "stderr" : null ,
11
+ "stderr_hash" : null ,
12
+ "returncode" : 0
13
+ }
Original file line number Diff line number Diff line change
1
+ (TOKEN "eolcomment") 0:10
2
+ (TOKEN "identifier" def) 11:13
3
+ (TOKEN "identifier" test) 15:18
4
+ (TOKEN "(") 19:19
5
+ (TOKEN ")") 20:20
6
+ (TOKEN ":") 21:21
7
+ (TOKEN "eolcomment") 23:34
8
+ (TOKEN "comment") 39:50
9
+ (KEYWORD "print") 55:59
10
+ (TOKEN "(") 60:60
11
+ (TOKEN ")") 61:61
12
+ (NEWLINE) 62:62
13
+ (TOKEN "comment") 63:74
14
+ (TOKEN "identifier" test) 75:78
15
+ (TOKEN "(") 79:79
16
+ (TOKEN ")") 80:80
17
+ (TOKEN "eolcomment") 82:93
18
+ (TOKEN "comment") 94:105
19
+ (NEWLINE) 106:106
20
+ (TOKEN "comment") 107:110
21
+ (TOKEN "comment") 111:123
22
+ (TOKEN "comment") 124:134
23
+ (EOF) 135:135
Original file line number Diff line number Diff line change @@ -217,3 +217,7 @@ asr = true
217
217
[[test ]]
218
218
filename = " tokens/docstring1.py"
219
219
tokens = true
220
+
221
+ [[test ]]
222
+ filename = " tokens/comment1.py"
223
+ tokens = true
Original file line number Diff line number Diff line change
1
+ #Comment 1
2
+ def test (): # Comment 2
3
+ # Comment 3
4
+ print ()
5
+ # Comment 4
6
+ test () # Comment 5
7
+ # Comment 5
8
+
9
+ # A
10
+ # Multi-line
11
+ # Comments
You can’t perform that action at this time.
0 commit comments