/
rust.md.pot
6389 lines (5556 loc) · 178 KB
/
rust.md.pot
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
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#. type: Plain text
#: doc/rust.md:2
msgid "% Rust Reference Manual"
msgstr ""
#. type: Plain text
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
#: doc/tutorial-borrowed-ptr.md:4 doc/tutorial-ffi.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4 doc/tut.md:4
msgid "# Introduction"
msgstr ""
#. type: Plain text
#: doc/rust.md:7
msgid ""
"This document is the reference manual for the Rust programming language. It "
"provides three kinds of material:"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:15
msgid ""
"Chapters that formally define the language grammar and, for each construct, "
"informally describe its semantics and give examples of its use."
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:15
msgid ""
"Chapters that informally describe the memory model, concurrency model, "
"runtime services, linkage model and debugging facilities."
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:15
msgid ""
"Appendix chapters providing rationale and references to languages that "
"influenced the design."
msgstr ""
#. type: Plain text
#: doc/rust.md:19
msgid ""
"This document does not serve as a tutorial introduction to the language. "
"Background familiarity with the language is assumed. A separate [tutorial] "
"document is available to help acquire such background familiarity."
msgstr ""
#. type: Plain text
#: doc/rust.md:24
msgid ""
"This document also does not serve as a reference to the [standard] or "
"[extra] libraries included in the language distribution. Those libraries are "
"documented separately by extracting documentation attributes from their "
"source code."
msgstr ""
#. type: Plain text
#: doc/rust.md:28
msgid ""
"[tutorial]: tutorial.html [standard]: std/index.html [extra]: extra/index."
"html"
msgstr ""
#. type: Plain text
#: doc/rust.md:30 doc/rustpkg.md:8
msgid "## Disclaimer"
msgstr ""
#. type: Plain text
#: doc/rust.md:34
msgid ""
"Rust is a work in progress. The language continues to evolve as the design "
"shifts and is fleshed out in working code. Certain parts work, certain parts "
"do not, certain parts will be removed or changed."
msgstr ""
#. type: Plain text
#: doc/rust.md:39
msgid ""
"This manual is a snapshot written in the present tense. All features "
"described exist in working code unless otherwise noted, but some are quite "
"primitive or remain to be further modified by planned work. Some may be "
"temporary. It is a *draft*, and we ask that you not take anything you read "
"here as final."
msgstr ""
#. type: Plain text
#: doc/rust.md:43
msgid ""
"If you have suggestions to make, please try to focus them on *reductions* to "
"the language: possible features that can be combined or omitted. We aim to "
"keep the size and complexity of the language under control."
msgstr ""
#. type: Plain text
#: doc/rust.md:52
msgid ""
"> **Note:** The grammar for Rust given in this document is rough and > very "
"incomplete; only a modest number of sections have accompanying grammar > "
"rules. Formalizing the grammar accepted by the Rust parser is ongoing work, "
"> but future versions of this document will contain a complete > grammar. "
"Moreover, we hope that this grammar will be extracted and verified > as "
"LL(1) by an automated grammar-analysis tool, and further tested against the "
"> Rust sources. Preliminary versions of this automation exist, but are not "
"yet > complete."
msgstr ""
#. type: Plain text
#: doc/rust.md:54
msgid "# Notation"
msgstr ""
#. type: Plain text
#: doc/rust.md:62
msgid ""
"Rust's grammar is defined over Unicode codepoints, each conventionally "
"denoted `U+XXXX`, for 4 or more hexadecimal digits `X`. _Most_ of Rust's "
"grammar is confined to the ASCII range of Unicode, and is described in this "
"document by a dialect of Extended Backus-Naur Form (EBNF), specifically a "
"dialect of EBNF supported by common automated LL(k) parsing tools such as "
"`llgen`, rather than the dialect given in ISO 14977. The dialect can be "
"defined self-referentially as follows:"
msgstr ""
#. type: Plain text
#: doc/rust.md:64
msgid "~~~~~~~~ {.ebnf .notation}"
msgstr ""
#. type: Plain text
#: doc/rust.md:72
#, no-wrap
msgid ""
"grammar : rule + ;\n"
"rule : nonterminal ':' productionrule ';' ;\n"
"productionrule : production [ '|' production ] * ;\n"
"production : term * ;\n"
"term : element repeats ;\n"
"element : LITERAL | IDENTIFIER | '[' productionrule ']' ;\n"
"repeats : [ '*' | '+' ] NUMBER ? | NUMBER ? | '?' ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:74 doc/rust.md:417 doc/rust.md:487
msgid "~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:76
msgid "Where:"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:89
msgid "Whitespace in the grammar is ignored."
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:89
msgid "Square brackets are used to group rules."
msgstr ""
#. type: Plain text
#: doc/rust.md:89
#, no-wrap
msgid ""
" - `LITERAL` is a single printable ASCII character, or an escaped hexadecimal\n"
" ASCII code of the form `\\xQQ`, in single quotes, denoting the corresponding\n"
" Unicode codepoint `U+00QQ`.\n"
" - `IDENTIFIER` is a nonempty string of ASCII letters and underscores.\n"
" - The `repeat` forms apply to the adjacent `element`, and are as follows:\n"
" - `?` means zero or one repetition\n"
" - `*` means zero or more repetitions\n"
" - `+` means one or more repetitions\n"
" - NUMBER trailing a repeat symbol gives a maximum repetition count\n"
" - NUMBER on its own gives an exact repetition count\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:91
msgid "This EBNF dialect should hopefully be familiar to many readers."
msgstr ""
#. type: Plain text
#: doc/rust.md:93
msgid "## Unicode productions"
msgstr ""
#. type: Plain text
#: doc/rust.md:98
msgid ""
"A few productions in Rust's grammar permit Unicode codepoints outside the "
"ASCII range. We define these productions in terms of character properties "
"specified in the Unicode standard, rather than in terms of ASCII-range "
"codepoints. The section [Special Unicode Productions](#special-unicode-"
"productions) lists these productions."
msgstr ""
#. type: Plain text
#: doc/rust.md:100
msgid "## String table productions"
msgstr ""
#. type: Plain text
#: doc/rust.md:109
msgid ""
"Some rules in the grammar -- notably [unary operators](#unary-operator-"
"expressions), [binary operators](#binary-operator-expressions), and "
"[keywords](#keywords) -- are given in a simplified form: as a listing of a "
"table of unquoted, printable whitespace-separated strings. These cases form "
"a subset of the rules regarding the [token](#tokens) rule, and are assumed "
"to be the result of a lexical-analysis phase feeding the parser, driven by a "
"DFA, operating over the disjunction of all such string table entries."
msgstr ""
#. type: Plain text
#: doc/rust.md:113
msgid ""
"When such a string enclosed in double-quotes (`\"`) occurs inside the "
"grammar, it is an implicit reference to a single member of such a string "
"table production. See [tokens](#tokens) for more information."
msgstr ""
#. type: Plain text
#: doc/rust.md:116
msgid "# Lexical structure"
msgstr ""
#. type: Plain text
#: doc/rust.md:118
msgid "## Input format"
msgstr ""
#. type: Plain text
#: doc/rust.md:124
msgid ""
"Rust input is interpreted as a sequence of Unicode codepoints encoded in "
"UTF-8, normalized to Unicode normalization form NFKC. Most Rust grammar "
"rules are defined in terms of printable ASCII-range codepoints, but a small "
"number are defined in terms of Unicode properties or explicit codepoint "
"lists. ^[Substitute definitions for the special Unicode productions are "
"provided to the grammar verifier, restricted to ASCII range, when verifying "
"the grammar in this document.]"
msgstr ""
#. type: Plain text
#: doc/rust.md:126
msgid "## Special Unicode Productions"
msgstr ""
#. type: Plain text
#: doc/rust.md:129
msgid ""
"The following productions in the Rust grammar are defined in terms of "
"Unicode properties: `ident`, `non_null`, `non_star`, `non_eol`, "
"`non_slash_or_star`, `non_single_quote` and `non_double_quote`."
msgstr ""
#. type: Plain text
#: doc/rust.md:131
msgid "### Identifiers"
msgstr ""
#. type: Plain text
#: doc/rust.md:133
msgid ""
"The `ident` production is any nonempty Unicode string of the following form:"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:136
msgid "The first character has property `XID_start`"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:136
msgid "The remaining characters have property `XID_continue`"
msgstr ""
#. type: Plain text
#: doc/rust.md:138
msgid "that does _not_ occur in the set of [keywords](#keywords)."
msgstr ""
#. type: Plain text
#: doc/rust.md:142
msgid ""
"Note: `XID_start` and `XID_continue` as character properties cover the "
"character ranges used to form the more familiar C and Java language-family "
"identifiers."
msgstr ""
#. type: Plain text
#: doc/rust.md:144
msgid "### Delimiter-restricted productions"
msgstr ""
#. type: Plain text
#: doc/rust.md:146
msgid ""
"Some productions are defined by exclusion of particular Unicode characters:"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:153
msgid "`non_null` is any single Unicode character aside from `U+0000` (null)"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:153
msgid "`non_eol` is `non_null` restricted to exclude `U+000A` (`'\\n'`)"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:153
msgid "`non_star` is `non_null` restricted to exclude `U+002A` (`*`)"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:153
msgid ""
"`non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U"
"+002A` (`*`)"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:153
msgid "`non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)"
msgstr ""
#. type: Bullet: ' - '
#: doc/rust.md:153
msgid "`non_double_quote` is `non_null` restricted to exclude `U+0022` (`\"`)"
msgstr ""
#. type: Plain text
#: doc/rust.md:155
msgid "## Comments"
msgstr ""
#. type: Plain text
#: doc/rust.md:162
msgid ""
"~~~~~~~~ {.ebnf .gram} comment : block_comment | line_comment ; "
"block_comment : \"/*\" block_comment_body * '*' + '/' ; block_comment_body : "
"non_star * | '*' + non_slash_or_star ; line_comment : \"//\" non_eol * ; "
"~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:165
msgid ""
"Comments in Rust code follow the general C++ style of line and block-comment "
"forms, with no nesting of block-comment delimiters."
msgstr ""
#. type: Plain text
#: doc/rust.md:170
msgid ""
"Line comments beginning with _three_ slashes (`///`), and block comments "
"beginning with a repeated asterisk in the block-open sequence (`/**`), are "
"interpreted as a special syntax for `doc` [attributes](#attributes). That "
"is, they are equivalent to writing `#[doc \"...\"]` around the comment's "
"text."
msgstr ""
#. type: Plain text
#: doc/rust.md:172
msgid "Non-doc comments are interpreted as a form of whitespace."
msgstr ""
#. type: Plain text
#: doc/rust.md:174
msgid "## Whitespace"
msgstr ""
#. type: Plain text
#: doc/rust.md:179
msgid ""
"~~~~~~~~ {.ebnf .gram} whitespace_char : '\\x20' | '\\x09' | '\\x0a' | "
"'\\x0d' ; whitespace : [ whitespace_char | comment ] + ; ~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:183
msgid ""
"The `whitespace_char` production is any nonempty Unicode string consisting "
"of any of the following Unicode characters: `U+0020` (space, `' '`), `U"
"+0009` (tab, `'\\t'`), `U+000A` (LF, `'\\n'`), `U+000D` (CR, `'\\r'`)."
msgstr ""
#. type: Plain text
#: doc/rust.md:186
msgid ""
"Rust is a \"free-form\" language, meaning that all forms of whitespace serve "
"only to separate _tokens_ in the grammar, and have no semantic significance."
msgstr ""
#. type: Plain text
#: doc/rust.md:189
msgid ""
"A Rust program has identical meaning if each whitespace element is replaced "
"with any other legal whitespace element, such as a single space character."
msgstr ""
#. type: Plain text
#: doc/rust.md:191
msgid "## Tokens"
msgstr ""
#. type: Plain text
#: doc/rust.md:196
msgid ""
"~~~~~~~~ {.ebnf .gram} simple_token : keyword | unop | binop ; token : "
"simple_token | ident | literal | symbol | whitespace token ; ~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:201
msgid ""
"Tokens are primitive productions in the grammar defined by regular (non-"
"recursive) languages. \"Simple\" tokens are given in [string table "
"production](#string-table-productions) form, and occur in the rest of the "
"grammar as double-quoted strings. Other tokens have exact rules given."
msgstr ""
#. type: Plain text
#: doc/rust.md:203
msgid "### Keywords"
msgstr ""
#. type: Plain text
#: doc/rust.md:205
msgid "The keywords are the following strings:"
msgstr ""
#. type: Plain text
#: doc/rust.md:223
msgid ""
"~~~~~~~~ {.keyword} as break copy do drop else enum extern false fn for if "
"impl let loop match mod mut priv pub ref return self static struct super "
"true trait type unsafe use while ~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:226
msgid ""
"Each of these keywords has special meaning in its grammar, and all of them "
"are excluded from the `ident` rule."
msgstr ""
#. type: Plain text
#: doc/rust.md:228
msgid "### Literals"
msgstr ""
#. type: Plain text
#: doc/rust.md:234
msgid ""
"A literal is an expression consisting of a single token, rather than a "
"sequence of tokens, that immediately and directly denotes the value it "
"evaluates to, rather than referring to it by name or some other evaluation "
"rule. A literal is a form of constant expression, so is evaluated "
"(primarily) at compile time."
msgstr ""
#. type: Plain text
#: doc/rust.md:238
msgid ""
"~~~~~~~~ {.ebnf .gram} literal : string_lit | char_lit | num_lit ; ~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:240
msgid "#### Character and string literals"
msgstr ""
#. type: Plain text
#: doc/rust.md:244
msgid ""
"~~~~~~~~ {.ebnf .gram} char_lit : '\\x27' char_body '\\x27' ; string_lit : "
"'\"' string_body * '\"' ;"
msgstr ""
#. type: Plain text
#: doc/rust.md:247
#, no-wrap
msgid ""
"char_body : non_single_quote\n"
" | '\\x5c' [ '\\x27' | common_escape ] ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:250
#, no-wrap
msgid ""
"string_body : non_double_quote\n"
" | '\\x5c' [ '\\x22' | common_escape ] ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:256
#, no-wrap
msgid ""
"common_escape : '\\x5c'\n"
" | 'n' | 'r' | 't'\n"
" | 'x' hex_digit 2\n"
" | 'u' hex_digit 4\n"
" | 'U' hex_digit 8 ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:264
#, no-wrap
msgid ""
"hex_digit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f'\n"
" | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'\n"
" | dec_digit ;\n"
"dec_digit : '0' | nonzero_dec ;\n"
"nonzero_dec: '1' | '2' | '3' | '4'\n"
" | '5' | '6' | '7' | '8' | '9' ;\n"
"~~~~~~~~\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:268
msgid ""
"A _character literal_ is a single Unicode character enclosed within two `U"
"+0027` (single-quote) characters, with the exception of `U+0027` itself, "
"which must be _escaped_ by a preceding U+005C character (`\\`)."
msgstr ""
#. type: Plain text
#: doc/rust.md:272
msgid ""
"A _string literal_ is a sequence of any Unicode characters enclosed within "
"two `U+0022` (double-quote) characters, with the exception of `U+0022` "
"itself, which must be _escaped_ by a preceding `U+005C` character (`\\`)."
msgstr ""
#. type: Plain text
#: doc/rust.md:276
msgid ""
"Some additional _escapes_ are available in either character or string "
"literals. An escape starts with a `U+005C` (`\\`) and continues with one of "
"the following forms:"
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:291
msgid ""
"An _8-bit codepoint escape_ escape starts with `U+0078` (`x`) and is "
"followed by exactly two _hex digits_. It denotes the Unicode codepoint equal "
"to the provided hex value."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:291
msgid ""
"A _16-bit codepoint escape_ starts with `U+0075` (`u`) and is followed by "
"exactly four _hex digits_. It denotes the Unicode codepoint equal to the "
"provided hex value."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:291
msgid ""
"A _32-bit codepoint escape_ starts with `U+0055` (`U`) and is followed by "
"exactly eight _hex digits_. It denotes the Unicode codepoint equal to the "
"provided hex value."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:291
msgid ""
"A _whitespace escape_ is one of the characters `U+006E` (`n`), `U+0072` "
"(`r`), or `U+0074` (`t`), denoting the unicode values `U+000A` (LF), `U"
"+000D` (CR) or `U+0009` (HT) respectively."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:291
msgid ""
"The _backslash escape_ is the character U+005C (`\\`) which must be escaped "
"in order to denote *itself*."
msgstr ""
#. type: Plain text
#: doc/rust.md:293
msgid "#### Number literals"
msgstr ""
#. type: Plain text
#: doc/rust.md:295 doc/rust.md:407 doc/rust.md:474
msgid "~~~~~~~~ {.ebnf .gram}"
msgstr ""
#. type: Plain text
#: doc/rust.md:300
#, no-wrap
msgid ""
"num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?\n"
" | '0' [ [ dec_digit | '_' ] + num_suffix ?\n"
" | 'b' [ '1' | '0' | '_' ] + int_suffix ?\n"
" | 'x' [ hex_digit | '_' ] + int_suffix ? ] ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:302
msgid "num_suffix : int_suffix | float_suffix ;"
msgstr ""
#. type: Plain text
#: doc/rust.md:306
#, no-wrap
msgid ""
"int_suffix : 'u' int_suffix_size ?\n"
" | 'i' int_suffix_size ? ;\n"
"int_suffix_size : [ '8' | '1' '6' | '3' '2' | '6' '4' ] ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:312
msgid ""
"float_suffix : [ exponent | '.' dec_lit exponent ? ] ? float_suffix_ty ? ; "
"float_suffix_ty : 'f' [ '3' '2' | '6' '4' ] ; exponent : ['E' | 'e'] ['-' | "
"'+' ] ? dec_lit ; dec_lit : [ dec_digit | '_' ] + ; ~~~~~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:316
msgid ""
"A _number literal_ is either an _integer literal_ or a _floating-point "
"literal_. The grammar for recognizing the two kinds of literals is mixed, as "
"they are differentiated by suffixes."
msgstr ""
#. type: Plain text
#: doc/rust.md:318
msgid "##### Integer literals"
msgstr ""
#. type: Plain text
#: doc/rust.md:320
msgid "An _integer literal_ has one of three forms:"
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:327
msgid ""
"A _decimal literal_ starts with a *decimal digit* and continues with any "
"mixture of *decimal digits* and _underscores_."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:327
msgid ""
"A _hex literal_ starts with the character sequence `U+0030` `U+0078` (`0x`) "
"and continues as any mixture hex digits and underscores."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:327
msgid ""
"A _binary literal_ starts with the character sequence `U+0030` `U+0062` "
"(`0b`) and continues as any mixture binary digits and underscores."
msgstr ""
#. type: Plain text
#: doc/rust.md:331
msgid ""
"An integer literal may be followed (immediately, without any spaces) by an "
"_integer suffix_, which changes the type of the literal. There are two kinds "
"of integer literal suffix:"
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:337
msgid ""
"The `i` and `u` suffixes give the literal type `int` or `uint`, respectively."
msgstr ""
#. type: Bullet: ' * '
#: doc/rust.md:337
msgid ""
"Each of the signed and unsigned machine types `u8`, `i8`, `u16`, `i16`, "
"`u32`, `i32`, `u64` and `i64` give the literal the corresponding machine "
"type."
msgstr ""
#. type: Plain text
#: doc/rust.md:344
msgid ""
"The type of an _unsuffixed_ integer literal is determined by type "
"inference. If a integer type can be _uniquely_ determined from the "
"surrounding program context, the unsuffixed integer literal has that type. "
"If the program context underconstrains the type, the unsuffixed integer "
"literal's type is `int`; if the program context overconstrains the type, it "
"is considered a static type error."
msgstr ""
#. type: Plain text
#: doc/rust.md:346
msgid "Examples of integer literals of various forms:"
msgstr ""
#. type: Plain text
#: doc/rust.md:351
#, no-wrap
msgid ""
"~~~~\n"
"123; 0xff00; // type determined by program context\n"
" // defaults to int in absence of type\n"
" // information\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:357
#, no-wrap
msgid ""
"123u; // type uint\n"
"123_u; // type uint\n"
"0xff_u8; // type u8\n"
"0b1111_1111_1001_0000_i32; // type i32\n"
"~~~~\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:359
msgid "##### Floating-point literals"
msgstr ""
#. type: Plain text
#: doc/rust.md:361
msgid "A _floating-point literal_ has one of two forms:"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:366
msgid ""
"Two _decimal literals_ separated by a period character `U+002E` (`.`), with "
"an optional _exponent_ trailing after the second decimal literal."
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:366
msgid "A single _decimal literal_ followed by an _exponent_."
msgstr ""
#. type: Plain text
#: doc/rust.md:373
msgid ""
"By default, a floating-point literal is of type `float`. A floating-point "
"literal may be followed (immediately, without any spaces) by a _floating-"
"point suffix_, which changes the type of the literal. There are three "
"floating-point suffixes: `f` (for the base `float` type), `f32`, and `f64` "
"(the 32-bit and 64-bit floating point types)."
msgstr ""
#. type: Plain text
#: doc/rust.md:375
msgid "Examples of floating-point literals of various forms:"
msgstr ""
#. type: Plain text
#: doc/rust.md:383
#, no-wrap
msgid ""
"~~~~\n"
"123.0; // type float\n"
"0.1; // type float\n"
"3f; // type float\n"
"0.1f32; // type f32\n"
"12E+99_f64; // type f64\n"
"~~~~\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:385
msgid "##### Unit and boolean literals"
msgstr ""
#. type: Plain text
#: doc/rust.md:388
msgid ""
"The _unit value_, the only value of the type that has the same name, is "
"written as `()`. The two values of the boolean type are written `true` and "
"`false`."
msgstr ""
#. type: Plain text
#: doc/rust.md:390
msgid "### Symbols"
msgstr ""
#. type: Plain text
#: doc/rust.md:396
#, no-wrap
msgid ""
"~~~~~~~~ {.ebnf .gram}\n"
"symbol : \"::\" \"->\"\n"
" | '#' | '[' | ']' | '(' | ')' | '{' | '}'\n"
" | ',' | ';' ;\n"
"~~~~~~~~\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:402
msgid ""
"Symbols are a general class of printable [token](#tokens) that play "
"structural roles in a variety of grammar productions. They are catalogued "
"here for completeness as the set of remaining miscellaneous printable tokens "
"that do not otherwise appear as [unary operators](#unary-operator-"
"expressions), [binary operators](#binary-operator-expressions), or [keywords]"
"(#keywords)."
msgstr ""
#. type: Plain text
#: doc/rust.md:405
msgid "## Paths"
msgstr ""
#. type: Plain text
#: doc/rust.md:411
#, no-wrap
msgid ""
"expr_path : ident [ \"::\" expr_path_tail ] + ;\n"
"expr_path_tail : '<' type_expr [ ',' type_expr ] + '>'\n"
" | expr_path ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:415
#, no-wrap
msgid ""
"type_path : ident [ type_path_tail ] + ;\n"
"type_path_tail : '<' type_expr [ ',' type_expr ] + '>'\n"
" | \"::\" type_path ;\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:422
msgid ""
"A _path_ is a sequence of one or more path components _logically_ separated "
"by a namespace qualifier (`::`). If a path consists of only one component, "
"it may refer to either an [item](#items) or a [slot](#memory-slots) in a "
"local control scope. If a path has multiple components, it refers to an item."
msgstr ""
#. type: Plain text
#: doc/rust.md:426
msgid ""
"Every item has a _canonical path_ within its crate, but the path naming an "
"item is only meaningful within a given crate. There is no global namespace "
"across crates; an item's canonical path merely identifies it within the "
"crate."
msgstr ""
#. type: Plain text
#: doc/rust.md:428
msgid "Two examples of simple paths consisting of only identifier components:"
msgstr ""
#. type: Plain text
#: doc/rust.md:433
msgid "~~~~{.ignore} x; x::y::z; ~~~~"
msgstr ""
#. type: Plain text
#: doc/rust.md:440
msgid ""
"Path components are usually [identifiers](#identifiers), but the trailing "
"component of a path may be an angle-bracket-enclosed list of type arguments. "
"In [expression](#expressions) context, the type argument list is given after "
"a final (`::`) namespace qualifier in order to disambiguate it from a "
"relational expression involving the less-than symbol (`<`). In type "
"expression context, the final namespace qualifier is omitted."
msgstr ""
#. type: Plain text
#: doc/rust.md:442
msgid "Two examples of paths with type arguments:"
msgstr ""
#. type: Plain text
#: doc/rust.md:451
#, no-wrap
msgid ""
"~~~~\n"
"# use std::hashmap::HashMap;\n"
"# fn f() {\n"
"# fn id<T:Copy>(t: T) -> T { t }\n"
"type t = HashMap<int,~str>; // Type arguments used in a type expression\n"
"let x = id::<int>(10); // Type arguments used in a call expression\n"
"# }\n"
"~~~~\n"
msgstr ""
#. type: Plain text
#: doc/rust.md:453
msgid "# Syntax extensions"
msgstr ""
#. type: Plain text
#: doc/rust.md:458
msgid ""
"A number of minor features of Rust are not central enough to have their own "
"syntax, and yet are not implementable as functions. Instead, they are given "
"names, and invoked through a consistent syntax: `name!(...)`. Examples "
"include:"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`fmt!` : format data into a string"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`env!` : look up an environment variable's value at compile time"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`stringify!` : pretty-print the Rust expression given as an argument"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`proto!` : define a protocol for inter-task communication"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`include!` : include the Rust expression in the given file"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`include_str!` : include the contents of the given file as a string"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid ""
"`include_bin!` : include the contents of the given file as a binary blob"
msgstr ""
#. type: Bullet: '* '
#: doc/rust.md:467
msgid "`error!`, `warn!`, `info!`, `debug!` : provide diagnostic information."
msgstr ""
#. type: Plain text
#: doc/rust.md:470
msgid ""
"All of the above extensions, with the exception of `proto!`, are expressions "
"with values. `proto!` is an item, defining a new name."
msgstr ""
#. type: Plain text
#: doc/rust.md:472
msgid "## Macros"
msgstr ""
#. type: Plain text
#: doc/rust.md:485
#, no-wrap
msgid ""
"expr_macro_rules : \"macro_rules\" '!' ident '(' macro_rule * ')'\n"
"macro_rule : '(' matcher * ')' \"=>\" '(' transcriber * ')' ';'\n"
"matcher : '(' matcher * ')' | '[' matcher * ']'\n"
" | '{' matcher * '}' | '$' ident ':' ident\n"
" | '$' '(' matcher * ')' sep_token? [ '*' | '+' ]\n"
" | non_special_token\n"
"transcriber : '(' transcriber * ')' | '[' transcriber * ']'\n"
" | '{' transcriber * '}' | '$' ident\n"
" | '$' '(' transcriber * ')' sep_token? [ '*' | '+' ]\n"
" | non_special_token\n"
msgstr ""