diff --git a/compiler/erg_parser/tests/test1_basic_syntax.er b/compiler/erg_parser/tests/test1_basic_syntax.er index 8b8d5a9b..4eddb3ff 100644 --- a/compiler/erg_parser/tests/test1_basic_syntax.er +++ b/compiler/erg_parser/tests/test1_basic_syntax.er @@ -1,5 +1,13 @@ -# 基本的な構文をパーサーがパスできるかチェックする -# Check that a parser can pass the basic syntax +#[ +基本的な構文をパーサーがパスできるかチェックする +Check that a parser can pass the basic syntax + #[ + `#[`から`]#`までが複数行コメントとして扱われる + コメント内部で入れ子で複数行コメントを付けれるが、閉じ忘れに注意 + The comment from `#[` to `]#` is treated as a multi-line comment. + Nested multi-line comments can be added inside comments, but be careful not to forget to close them. + ]# +]# _a = 1_234 + 1113.* 3_000.2e-4 ** 0003 * .4 a, _, ...b = five_elem_tuple @@ -7,6 +15,10 @@ f x, y = x + y if! True, do!: print! "\"\\hello, world\\\"" + #[ + indented comment +dedented comment + ]# 10.times! do!: if! x.y.z, do!: print! "" diff --git a/compiler/erg_parser/tests/tokenize_test.rs b/compiler/erg_parser/tests/tokenize_test.rs index 6371de34..fca29d8b 100644 --- a/compiler/erg_parser/tests/tokenize_test.rs +++ b/compiler/erg_parser/tests/tokenize_test.rs @@ -18,7 +18,6 @@ fn test_lexer_for_basic() -> ParseResult<()> { let mut lexer = Lexer::new(Input::File(FILE1.into())); let newline = "\n"; let /*mut*/ token_array = vec![ - (Newline, newline), (Newline, newline), (Newline, newline), (Symbol, "_a"), @@ -64,6 +63,7 @@ fn test_lexer_for_basic() -> ParseResult<()> { (Symbol, "print!"), (StrLit, "\"\"\\hello, world\\\"\""), (Newline, newline), + (Newline, newline), (NatLit, "10"), (Dot, "."), (Symbol, "times!"),