mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
block comment
This commit is contained in:
parent
9431270504
commit
7be91158dc
11
README.md
11
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
|
||||
|
|
|
@ -121,10 +121,19 @@ pub fn lexer() -> impl Parser<char, Vec<(Token, Span)>, Error = Simple<char>> {
|
|||
.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()
|
||||
|
|
Loading…
Reference in a new issue