Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

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

Open
AlekSi opened this issue Oct 7, 2018 · 6 comments
Open

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

AlekSi opened this issue Oct 7, 2018 · 6 comments
Labels
feature New feature or improvement help wanted Small and self-contained issues for new contributors

Comments

@AlekSi
Copy link
Member

AlekSi commented Oct 7, 2018

Currently true and false are treated as keywords:

gosh/scanner/scanner.go

Lines 61 to 63 in 5198cfb

// TODO remove - those are not keywords
"true": tokens.True,
"false": tokens.False,

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 AlekSi added help wanted Small and self-contained issues for new contributors hacktoberfest labels Oct 7, 2018
@JacksonIsaac
Copy link

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

@JacksonIsaac
Copy link

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.

@AlekSi
Copy link
Member Author

AlekSi commented Oct 7, 2018

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?;

@JacksonIsaac
Copy link

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).

@AlekSi
Copy link
Member Author

AlekSi commented Oct 8, 2018

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
Copy link
Member Author

AlekSi commented Nov 4, 2018

@JacksonIsaac How can I help you with this?

@AlekSi AlekSi added the feature New feature or improvement label Nov 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or improvement help wanted Small and self-contained issues for new contributors
Projects
None yet
Development

No branches or pull requests

2 participants