Skip to content

Commit

Permalink
wip(parser): fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
emil14 committed May 3, 2024
1 parent 645dfcf commit 83aa86a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"mode": "auto",
"program": "${workspaceFolder}/cmd/neva",
"cwd": "${workspaceFolder}",
"args": ["run", "e2e/stream_to_list/main"]
"args": ["run", "examples/hello_world"]
},
{
"name": "LSP",
Expand Down
2 changes: 2 additions & 0 deletions examples/split_join_string/main.neva
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { strings }

component Main(start) (stop) {
nodes { Println, strings.Split, strings.Join }
net {
Expand Down
10 changes: 3 additions & 7 deletions internal/compiler/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/nevalang/neva/internal/compiler"
generated "github.com/nevalang/neva/internal/compiler/parser/generated"
src "github.com/nevalang/neva/internal/compiler/sourcecode"
"github.com/nevalang/neva/internal/compiler/sourcecode/core"
)

type treeShapeListener struct {
Expand Down Expand Up @@ -139,16 +138,13 @@ func (p Parser) parseFile(

if len(lexerErrors.Errors) > 0 {
return src.File{}, &compiler.Error{
Err: errors.Join(lexerErrors.Errors...),
Location: &src.Location{},
Meta: &core.Meta{},
Err: lexerErrors.Errors[0],
}
}

if len(parserErrors.Errors) > 0 {
return src.File{}, &compiler.Error{
Err: errors.Join(parserErrors.Errors...),
Location: &src.Location{},
Meta: &core.Meta{},
Err: parserErrors.Errors[0],
}
}

Expand Down

0 comments on commit 83aa86a

Please sign in to comment.