From 48cb50af1373a00964f32ba99383608982749ec6 Mon Sep 17 00:00:00 2001 From: John Clements Date: Wed, 27 Mar 2013 10:16:07 -0700 Subject: [PATCH 1/3] fixes stated grammar for block comments, by adding Kleene '+' in two places. Closes #1588 --- doc/rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index 60a83662b0e4c..3435cdbf9fe1f 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -155,8 +155,8 @@ Some productions are defined by exclusion of particular Unicode characters: ~~~~~~~~ {.ebnf .gram} comment : block_comment | line_comment ; -block_comment : "/*" block_comment_body * "*/" ; -block_comment_body : non_star * | '*' non_slash ; +block_comment : "/*" block_comment_body * "*" + "/" ; +block_comment_body : non_star * | '*' + non_slash ; line_comment : "//" non_eol * ; ~~~~~~~~ From 81d30ade6177fcfd2319ce139b98722bbe7f4ed3 Mon Sep 17 00:00:00 2001 From: John Clements Date: Thu, 28 Mar 2013 10:19:08 -0700 Subject: [PATCH 2/3] fix another subtle bug in comment regex --- doc/rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index 3435cdbf9fe1f..b45a426c6b3e5 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -155,8 +155,8 @@ Some productions are defined by exclusion of particular Unicode characters: ~~~~~~~~ {.ebnf .gram} comment : block_comment | line_comment ; -block_comment : "/*" block_comment_body * "*" + "/" ; -block_comment_body : non_star * | '*' + non_slash ; +block_comment : "/*" block_comment_body * '*' + '/' ; +block_comment_body : non_star * | '*' + non_slash_or_star ; line_comment : "//" non_eol * ; ~~~~~~~~ From dcb8fa8f35da8abd8a3a6ed9d542f2e04b4c4d69 Mon Sep 17 00:00:00 2001 From: John Clements Date: Thu, 28 Mar 2013 10:23:20 -0700 Subject: [PATCH 3/3] added defn of non_slash_or_star --- doc/rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index b45a426c6b3e5..ab337214148a3 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -125,7 +125,7 @@ but a small number are defined in terms of Unicode properties or explicit codepo ## Special Unicode Productions The following productions in the Rust grammar are defined in terms of Unicode properties: -`ident`, `non_null`, `non_star`, `non_eol`, `non_slash`, `non_single_quote` and `non_double_quote`. +`ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`, `non_single_quote` and `non_double_quote`. ### Identifiers @@ -147,7 +147,7 @@ Some productions are defined by exclusion of particular Unicode characters: - `non_null` is any single Unicode character aside from `U+0000` (null) - `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`) - `non_star` is `non_null` restricted to exclude `U+002A` (`*`) - - `non_slash` is `non_null` restricted to exclude `U+002F` (`/`) + - `non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U+002A` (`*`) - `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`) - `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)