Skip to content

Commit 20c206f

Browse files
committed
---
yaml --- r: 41854 b: refs/heads/master c: b3cbe9e h: refs/heads/master v: v3
1 parent 15a2cf6 commit 20c206f

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 50c8cbb25aeb9d8132ac06914e9978d3cddb7f42
2+
refs/heads/master: b3cbe9e3c1115239997e806498fa5bc7eea7bc98
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/etc/extract-tests.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# Script for extracting compilable fragments from markdown
44
# documentation. See prep.js for a description of the format
5-
# recognized by this tool. Expects a directory fragements/ to exist
5+
# recognized by this tool. Expects a directory fragments/ to exist
66
# under the current directory, and writes the fragments in there as
77
# individual .rs files.
88

9-
import sys, re;
9+
import sys, re
1010

1111
if len(sys.argv) < 3:
1212
print("Please provide an input filename")
@@ -26,7 +26,7 @@
2626
while cur < len(lines):
2727
line = lines[cur]
2828
cur += 1
29-
chap = re.match("# (.*)", line);
29+
chap = re.match("# (.*)", line)
3030
if chap:
3131
chapter = re.sub(r"\W", "_", chap.group(1)).lower()
3232
chapter_n = 1
@@ -51,14 +51,30 @@
5151
else:
5252
# Lines beginning with '# ' are turned into valid code
5353
line = re.sub("^# ", "", line)
54-
# Allow elipses in code snippets
54+
# Allow ellipses in code snippets
5555
line = re.sub("\.\.\.", "", line)
5656
block += line
5757
if not ignore:
5858
if not re.search(r"\bfn main\b", block):
5959
block = "fn main() {\n" + block + "\n}\n"
6060
if not re.search(r"\bextern mod std\b", block):
61-
block = "extern mod std;\n" + block;
61+
block = "extern mod std;\n" + block
62+
block = """#[ forbid(ctypes) ];
63+
#[ forbid(deprecated_mode) ];
64+
#[ forbid(deprecated_pattern) ];
65+
#[ forbid(implicit_copies) ];
66+
#[ forbid(non_implicitly_copyable_typarams) ];
67+
#[ forbid(path_statement) ];
68+
#[ forbid(type_limits) ];
69+
#[ forbid(unrecognized_lint) ];
70+
#[ forbid(unused_imports) ];
71+
#[ forbid(vecs_implicitly_copyable) ];
72+
#[ forbid(while_true) ];
73+
74+
#[ warn(deprecated_self) ];
75+
#[ warn(non_camel_case_types) ];
76+
#[ warn(structural_records) ];\n
77+
""" + block
6278
if xfail:
6379
block = "// xfail-test\n" + block
6480
filename = (dest + "/" + str(chapter)

0 commit comments

Comments
 (0)