DrSensor / DrSensor/scdlang

Error on Parser::parse when a file doesn't have expressions (max 3 lines)

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
103
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Given this file then execute `scrap code $file -f xstate`:
3 lines empty.scl

```scl

```
will produce:
```console
ERROR: can't parse
---
--> examples/test.scl:3:1
|
3 |
| ^---
|
= expected expression
---
```

3 lines with comment.scl

```scl
// A -> B @ Click
// A <-> B @ Toggle
// ->> B @ Click
```
will produce:
```console
ERROR: can't parse
---
--> examples/test.scl:3:17
|
3 | // ->> B @ Click
| ^---
|
= expected expression
---
```

end with with comment.scl

```scl
// A -> B @ Click

// ->> B @ Click
```
will produce:
```console
ERROR: can't parse
---
--> examples/test.scl:3:17
|
3 | // ->> B @ Click
| ^---
|
= expected expression
---
```

end with with empty line.scl

```scl
// A -> B @ Click
// ->> B @ Click

```
will produce:
```console
ERROR: can't parse
---
--> examples/test.scl:3:1
|
3 |
| ^---
|
= expected expression
---
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.