Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Research way to parse message into AST #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TejasSC
Copy link
Contributor

@TejasSC TejasSC commented Sep 6, 2018

Resolves #6

@TejasSC TejasSC self-assigned this Sep 6, 2018
@TejasSC TejasSC requested a review from chshersh September 6, 2018 07:23
@TejasSC
Copy link
Contributor Author

TejasSC commented Sep 6, 2018

screen shot 2018-09-06 at 3 23 15 pm

So for some reason I can't resolve this error even though i'm using a content as a String, which I break up into lines later on...

@chshersh
Copy link
Contributor

chshersh commented Sep 6, 2018

@TejasSC The problem is in the type of parseName function.

parseName :: FilePath -> String

This is a pure function. But since String is a type alias to [Char] and you're using monadic do-notation, that compiler assumes that you're working inside [] monad where readFile works in IO monad:

readFile :: FilePath -> IO String

@TejasSC
Copy link
Contributor Author

TejasSC commented Sep 7, 2018

screen shot 2018-09-07 at 12 29 56 pm

So this keeps happening everytime I set a filepath argument to "protobuf2.proto"
Should I read from this file?

@chshersh
Copy link
Contributor

chshersh commented Sep 7, 2018

@TejasSC When you launch your executable it's running in your project root (if you executing it while you're in project root). I guess if you change your path to proto/protobuf2.proto (by explcitly specifying full relative path from project root) it should find the file.

@chshersh chshersh removed their request for review October 14, 2019 12:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants