From db773bf735ef563a8b176d1ff88a25bfbe49a113 Mon Sep 17 00:00:00 2001 From: Natapat Samutpong Date: Thu, 17 Feb 2022 13:50:32 +0700 Subject: [PATCH] C-style comment --- example/ex.hyc | 3 ++- src/front/parse.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example/ex.hyc b/example/ex.hyc index 360de97..536d4a0 100644 --- a/example/ex.hyc +++ b/example/ex.hyc @@ -1,4 +1,5 @@ fun foo a b = a == b; fun bar a b = { a == b }; let res = foo(34, 35); -let res = { foo(34, 35) }; \ No newline at end of file +let res = { foo(34, 35) }; +/* comment */ \ No newline at end of file diff --git a/src/front/parse.rs b/src/front/parse.rs index 3fe04fa..f7e4c24 100644 --- a/src/front/parse.rs +++ b/src/front/parse.rs @@ -83,7 +83,7 @@ pub fn lexer() -> impl Parser, Error = Simple> { .or(keyword) .recover_with(skip_then_retry_until([])); - let comment = just("//").then(take_until(just('\n'))) + let comment = just("/*").then(take_until(just("*/"))) .padded() .ignored();