diff --git a/README.md b/README.md index 2c9b5e2..cc785ff 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ # Hazure Programming language that compiles to C++! -```sml +```kotlin fun main: int = do @write("Hello, World!\n"); return 69; end; ``` - +or with the pipe operator: +```kotlin +fun main: int = do + "Hello, World!\n" + |> @write(); + return 69; +end; +``` Note: Everything in this project can be changed at anytime! (I'm still finding out what work best for lots of thing) if you have an idea, feel free to create an issues about it, or even create a PR! (I'd be very happy) # Prerequistie diff --git a/crates/lexer/src/lib.rs b/crates/lexer/src/lib.rs index d434335..4f00626 100644 --- a/crates/lexer/src/lib.rs +++ b/crates/lexer/src/lib.rs @@ -121,10 +121,19 @@ pub fn lexer() -> impl Parser, Error = Simple> { .or(keyword) .recover_with(skip_then_retry_until([])); - let comment = just("--").then(take_until(just('\n'))).padded(); + // let comment = just("--").then(take_until(just('\n'))).padded(); + let comment = just('-') + .then_ignore(just('{') + .ignore_then(none_of('}').ignored().repeated()) + .then_ignore(just("}-")) + .or(none_of('\n').ignored().repeated()) + ) + .padded() + .ignored() + .repeated(); token - .padded_by(comment.repeated()) + .padded_by(comment) .map_with_span(|token, span| (token, span)) .padded() .repeated()