gosh icon indicating copy to clipboard operation
gosh copied to clipboard

Do not treat true and false as special token types and keywords

Open AlekSi opened this issue 5 years ago • 6 comments

Currently true and false are treated as keywords: https://github.com/gosh-lang/gosh/blob/5198cfb34427a8fd46e06b811a8fd4525c2b4eef/scanner/scanner.go#L61-L63

But they are normal predeclared identifiers like println. We should treat them as such. We also should remove special token types for them.

Scanner and parser should return them as identifiers, and they should be added into built-in objects.

AlekSi avatar Oct 07 '18 12:10 AlekSi

Working on this. Hope I can get the environment setup for running and testing.

JacksonIsaac avatar Oct 07 '18 19:10 JacksonIsaac

I somehow managed to run 'make', had to also use 'sudo make'. I am stuck after this step. I tried to find any getting started or documentation but didn't find any.

Any help would be appreciated.

JacksonIsaac avatar Oct 07 '18 19:10 JacksonIsaac

Normally, you should not use sudo. How you installed Go? Do you have GOPATH set? Did you download Gosh with go get -v gosh-lang.org/gosh?;

AlekSi avatar Oct 07 '18 20:10 AlekSi

I installed go via MacPorts.

I tried to setup gosh by doing a git clone and ran make. I had to also uncomment go:generate stringer -type Type for it to build once in the beginning. After that I was getting permission denied for some go related files, hence had to do sudo make (which is not the best way to do it, though).

JacksonIsaac avatar Oct 07 '18 20:10 JacksonIsaac

It is probably easier to remove everything and start from scratch.

  • Re-install Go, check go version – it should be 1.11 or 1.11.1.
  • Do not set environment variables GOPATH and GOROOT explicitly.
  • Run go get -u -v gosh-lang.org/gosh. This will use default GOPATH at ~/go and put source code into ~/go/src/gosh-lang.org/gosh.
  • Then you need to vendor dependencies: env GO111MODULE=on go mod vendor -v.
  • After that run make init and make.

If something does not work, please put an output of the all commands above plus go env.

AlekSi avatar Oct 08 '18 05:10 AlekSi

@JacksonIsaac How can I help you with this?

AlekSi avatar Nov 04 '18 12:11 AlekSi