summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-08-21 00:04:01 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-08-21 00:04:01 +0200
commit5304b16a55e7d7c1ec66a4ba5abe48651ba0eae1 (patch)
treef16602998450c575b55f5eda80ae10d81cfdaa8a /doc
parent4264e9576d0f3753dcff206fcff06217f2e70833 (diff)
downloadNim-5304b16a55e7d7c1ec66a4ba5abe48651ba0eae1.tar.gz
Fix typos. Apply title case. (#11987)
Diffstat (limited to 'doc')
-rw-r--r--doc/tut3.rst22
1 files changed, 11 insertions, 11 deletions
diff --git a/doc/tut3.rst b/doc/tut3.rst
index 720b4fb37..c71711ca9 100644
--- a/doc/tut3.rst
+++ b/doc/tut3.rst
@@ -52,7 +52,7 @@ Untyped Arguments
 Untyped macro arguments are passed to the macro before they are
 semantically checked. This means the syntax tree that is passed down
 to the macro does not need to make sense for Nim yet, the only
-limitation is that it needs to be parseable. Usually the macro does
+limitation is that it needs to be parsable. Usually the macro does
 not check the argument either but uses it in the transformation's
 result somehow. The result of a macro expansion is always checked
 by the compiler, so apart from weird error messages nothing bad
@@ -99,7 +99,7 @@ but in the macro body ``arg`` is just like a normal parameter of type
   myMacro(1 + 2 * 3)
 
 
-Code blocks as arguments
+Code Blocks as Arguments
 ------------------------
 
 It is possible to pass the last argument of a call expression in a
@@ -153,7 +153,7 @@ but does nothing else. Here is an example of such a tree representation:
   #             StrLit "abcdef"
 
 
-Custom sematic checking
+Custom Semantic Checking
 -----------------------
 
 The first thing that a macro should do with its arguments is to check
@@ -179,7 +179,7 @@ tree with expressions that contain a lot of calls to ``newTree`` and
 the best low level control for the syntax tree generation, but the
 second option is much less verbose. If you choose to create the syntax
 tree with calls to ``newTree`` and ``newLit`` the macro
-``marcos.dumpAstGen`` can help you with the verbosity. ``quote do:``
+``macros.dumpAstGen`` can help you with the verbosity. ``quote do:``
 allows you to write the code that you want to generate literally,
 backticks are used to insert code from ``NimNode`` symbols into the
 generated expression. This means that you can't use backticks within
@@ -220,10 +220,10 @@ The call to ``myMacro`` will generate the following code:
   echo MyType(a: 123.456'f64, b: "abcdef")
 
 
-Building your first macro
+Building Your First Macro
 -------------------------
 
-To give a footstart to writing macros we will show now how to
+To give a starting point to writing macros we will show now how to
 implement the ``myDebug`` macro mentioned earlier. The first thing to
 do is to build a simple example of the macro usage, and then just
 print the argument. This way it is possible to get an idea of a
@@ -250,10 +250,10 @@ correct argument should be look like.
     Ident "b"
 
 
-From the output it is possible to see that the information that the
-argument is an infix operator (node kind is "Infix"), as well as that the two
-operands are at index 1 and 2. With this information the actual
-macro can be written.
+From the output it is possible to see that the argument is an infix
+operator (node kind is "Infix"), as well as that the two operands are
+at index 1 and 2. With this information the actual macro can be
+written.
 
 .. code-block:: nim
     :test: "nim c $1"
@@ -330,7 +330,7 @@ in a macro like here is generally not recommended. The parsed AST
 cannot have type information, and parsing implemented on the VM is
 generally not very fast. Working on AST nodes is almost always the
 recommended way. But still ``strformat`` is a good example for a
-practical use case for a macro that is slightly more complex that the
+practical use case for a macro that is slightly more complex than the
 ``assert`` macro.
 
 `Strformat <https://github.com/nim-lang/Nim/blob/5845716df8c96157a047c2bd6bcdd795a7a2b9b1/lib/pure/strformat.nim#L280>`_
d=e512358bc96b7be58bf4f2d5a2c5de75f119138a'>^
c6264ed84 ^
ce86b4ad7 ^























































c817e85f4 ^
ce86b4ad7 ^














4b761295e ^
ce86b4ad7 ^




















































c94647aec ^
ce86b4ad7 ^






































dbf8d0b89 ^
ce86b4ad7 ^










fdf1d1238 ^

ce86b4ad7 ^





















ce86b4ad7 ^






99078d80d ^
ce86b4ad7 ^
































bc7733827 ^
a27429304 ^
ce86b4ad7 ^














805186809 ^

ce86b4ad7 ^









99078d80d ^
ce86b4ad7 ^



bc7733827 ^
ce86b4ad7 ^
99078d80d ^
ce86b4ad7 ^
99078d80d ^
ce86b4ad7 ^




99078d80d ^
ce86b4ad7 ^

























































































bc7733827 ^
ce86b4ad7 ^











ce86b4ad7 ^








005572975 ^






c94647aec ^



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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582