Skip to content

Commit ad857e2

Browse files
committed
Fix translations.
1 parent 99219d3 commit ad857e2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

1.6/ja/book/macros.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ macro_rules! vec { ... }
117117
<!-- exclamation point, e.g. `vec!`. The exclamation point is part of the invocation -->
118118
<!-- syntax and serves to distinguish a macro from an ordinary function. -->
119119
これは、新しいマクロ `vec` を定義していることを意味しています、`vec` という関数を定義するときに `fn vec` と書くのと同じです。
120-
散文的に、非形式的にマクロ名をエクスクラメーションマーク(!) と共に記述します、例えば: `vec!` のように示します。
120+
非公式ですが、実際には、マクロ名をエクスクラメーションマーク(!) と共に記述します、例えば: `vec!` のように示します。
121121
エクスクラメーションマークはマクロ呼び出しの構文の一部で、マクロと通常の関数の区別をつけるためのものです。
122122

123123
<!-- ## Matching -->
@@ -300,7 +300,7 @@ fn main() {
300300
上のコードはほとんどのマッチャーの構文を利用しています。
301301
この例では0個以上にマッチする `$(...)*` を利用しています、
302302
1つ以上にマッチさせたい場合は `$(...)+` を代りに利用する事ができます。
303-
また、どちらも補助的に区切りを指定する事ができます。区切りには、 `+``*` 意外の任意のトークンを指定することが可能です
303+
また、どちらも補助的に区切りを指定する事ができます。区切りには、 `+``*` 以外の任意のトークンを指定することが可能です
304304

305305
<!-- This system is based on -->
306306
<!-- "[Macro-by-Example](https://www.cs.indiana.edu/ftp/techreports/TR206.pdf)" -->
@@ -387,7 +387,7 @@ if (state > 0) {
387387
<!-- The second variable named `state` shadows the first one. This is a problem -->
388388
<!-- because the print statement should refer to both of them. -->
389389
2番目の変数 `state` は1つめの `state` を隠してしまいます。
390-
これは、print文が両方の変数を参照する必要があるためです
390+
この問題は、print文が両方の変数を参照する必要があるために起こります
391391

392392
<!-- The equivalent Rust macro has the desired behavior. -->
393393
Rustにおける同様のマクロは期待する通りの動作をします。
@@ -479,7 +479,7 @@ fn main() {
479479
<!-- processing tree-structured input, as illustrated by this (simplistic) HTML -->
480480
<!-- shorthand: -->
481481
マクロの展開は、展開中のマクロ自身も含めたその他のマクロ呼出しを含んでいることが可能です。
482-
そのような、以下の単純化したHTMLの短縮形のような、再帰的なマクロは木構造を持つ入力の処理に便利です:
482+
そのような再帰的なマクロは、以下の(単純化した)HTMLの短縮形のような、木構造を持つ入力の処理に便利です:
483483

484484
```rust
485485
# #![allow(unused_must_use)]
@@ -532,7 +532,7 @@ fn main() {
532532

533533
<!-- `rustc` provides two syntax extensions that help with macro debugging. For now, -->
534534
<!-- they are unstable and require feature gates. -->
535-
`rustc` はマクロのデバッグを補助する2つの構文を提供しています
535+
`rustc` はマクロのデバッグを補助する2つの構文拡張を提供しています
536536
今のところは、それらの構文は不安定であり、フィーチャーゲートを必要としています。
537537

538538
<!-- * `log_syntax!(...)` will print its arguments to standard output, at compile -->
@@ -589,18 +589,18 @@ Rustはこの曖昧性を判定するためにRustは単純なルールを利用
589589
<!-- must be balanced within a macro invocation. For example, `foo!([)` is -->
590590
<!-- forbidden. This allows Rust to know where the macro invocation ends. -->
591591
その他の展開前にパース可能である事による制約はマクロ呼出は正しいRustトークンで構成されている必要があるというものです。
592-
そのうえ、括弧や、各カッコ、波括弧はマクロ呼出し中でバランスしてなければなりません。
592+
そのうえ、括弧や、角カッコ、波括弧はマクロ呼出し中でバランスしてなければなりません。
593593
例えば: `foo!([)` は禁止されています。
594594
これによってRustはマクロ呼出しがどこで終わっているかを知ることができます。
595595

596596
<!-- More formally, the macro invocation body must be a sequence of ‘token trees’. -->
597597
<!-- A token tree is defined recursively as either -->
598598
もっと厳密に言うと、マクロ呼出しの本体は「トークンの木」のシーケンスである必要があります。
599-
トークンの木は以下の条件により再帰的に定義されています
599+
トークンの木は以下のいずれかの条件により再帰的に定義されています
600600

601601
<!-- * a sequence of token trees surrounded by matching `()`, `[]`, or `{}`, or -->
602602
<!-- * any other single token. -->
603-
* マッチャー、 `()``[]` または `{}` で囲まれたトークンの木
603+
* マッチャー、 `()``[]` または `{}` で囲まれたトークンの木、あるいは、
604604
* その他の単一のトークン
605605

606606
<!-- Within a matcher, each metavariable has a ‘fragment specifier’, identifying -->
@@ -619,11 +619,11 @@ Rustはこの曖昧性を判定するためにRustは単純なルールを利用
619619
<!-- * `meta`: a "meta item", as found in attributes. Example: `cfg(target_os = "windows")`. -->
620620
<!-- * `tt`: a single token tree. -->
621621
* `ident`: 識別子。 例: `x`; `foo`
622-
* `path`: 量化された名前。例: `T::SpecialA`
622+
* `path`: 修飾された名前。例: `T::SpecialA`
623623
* `expr`: 式。 例: `2 + 2`; `if true { 1 } else { 2 }`; `f(42)`
624624
* `ty`: 型。 例: `i32`; `Vec<(char, String)>`; `&T`
625625
* `pat`: パターン。 例: `Some(t)`; `(17, 'a')`; `_`
626-
* `stmt`: 単一の式。 例: `let x = 3`
626+
* `stmt`: 単一の文。 例: `let x = 3`
627627
* `block`: 波括弧で区切られた文のシーケンス。 例: `{ log(error, "hi"); return 12 }`
628628
* `item`: [アイテム][item]。 例: `fn foo() { }`; `struct Bar;`
629629
* `meta`: アトリビュートで見られるような「メタアイテム」。 例: `cfg(target_os = "windows")`
@@ -840,7 +840,7 @@ macro_rules! inc {
840840
<!-- As an extreme example, it is possible, though hardly advisable, to implement -->
841841
<!-- the [Bitwise Cyclic Tag](https://esolangs.org/wiki/Bitwise_Cyclic_Tag) automaton -->
842842
<!-- within Rust’s macro system. -->
843-
極端な例としては、 [Bitwise Cyclic Tag](https://esolangs.org/wiki/Bitwise_Cyclic_Tag) のオートマトンをRustのマクロで実装する事が可能です。
843+
極端な例としては、 望ましくはありませんが、 [Bitwise Cyclic Tag](https://esolangs.org/wiki/Bitwise_Cyclic_Tag) のオートマトンをRustのマクロで実装する事が可能です。
844844

845845
```rust
846846
macro_rules! bct {
@@ -940,7 +940,7 @@ assert_eq!(5, 3);
940940
<!-- `Err(E)` if it’s that. Like this: -->
941941
`try!` はエラーハンドリングのために利用されています。
942942
`try!``Result<T, E>` を返す何らかの物を引数に取り、もし `Result<T, E>``Ok<T>` だった場合 `T` を、
943-
そうでなく `Err(E)` だった場合はそれを `return` します
943+
そうでなく `Err(E)` だった場合はそれを返します
944944
例えば以下のように利用します:
945945

946946
```rust,no_run
@@ -1020,6 +1020,6 @@ match x {
10201020
もしRustのマクロシステムでは必要としていることができない場合、
10211021
[コンパイラプラグイン](compiler-plugins.html) を代わりに書きたくなるでしょう。
10221022
コンパイラプラグインは `macro_rules!` マクロとくらべて、更に多くの作業が必要になり、
1023-
インタフェースは少し不安定であり、バグはさらに追跡が困難になります。
1023+
インタフェースはかなり不安定であり、バグはさらに追跡が困難になります。
10241024
引き換えに、任意のコードをコンパイラ中で実行できるという自由度を得ることができます。
10251025
構文拡張プラグインがしばしば「手続きマクロ」と呼ばれるのはこのためです。

0 commit comments

Comments
 (0)