Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 167 #172

Merged
merged 2 commits into from
Feb 24, 2015
Merged

Issue 167 #172

merged 2 commits into from
Feb 24, 2015

Conversation

bryant
Copy link
Contributor

@bryant bryant commented Feb 24, 2015

This pull request fixes #167.

Part of the problem is that Cryptol.Parser.LexerUtils.layout never has a chance to insert a matching VCurlR to a VCurlL inserted immediately an EOF:

*Main> mapM_ print . map thing . fst $ lexer defaultConfig "module M where"
Token {tokenType = KW KW_module, tokenText = "module"}
Token {tokenType = Ident "M", tokenText = "M"}
Token {tokenType = KW KW_where, tokenText = "where"}
Token {tokenType = Virt VCurlyL, tokenText = "beginning of layout block"}
Token {tokenType = EOF, tokenText = "end of file"}

@elliottt
Copy link
Contributor

Seems pretty straight forward to me. Thanks for the fix!

elliottt added a commit that referenced this pull request Feb 24, 2015
@elliottt elliottt merged commit a0f60c3 into GaloisInc:master Feb 24, 2015
acfoltzer pushed a commit that referenced this pull request Mar 24, 2015
There's now a more sensible hierarchy of locations that Cryptol uses to
look for modules. By default, in order it looks for libraries in:

1. The directories specified in the CRYPTOLPATH environment variable
2. The current directory
3. The user data directory (something like `$HOME/.cryptol`)
4. Relative to the executable's install directory
5. The static path used when building the executable (cabal's data-dir)

There is also a new command-line flag for the interpreter:
`--cryptolpath-only` which makes the interpreter ignore locations 2-5.

This commit also reworks the Makefile and build/release process. These
are bunched together because they play off each other quite a bit; the
build/release process determines the location of the `Cryptol.cry`,
which must be found when looking for modules.

Rather than leaning on `cabal install`, we now use a combination of
`cabal configure`, `cabal build`, and `cabal copy`. A couple of upshots
to this:

- More of the release staging is handled by cabal -- we don't have to go
  in and manually copy things out of the sandbox. In fact, the `cryptol`
  executable never goes into the sandbox.

- The testing infrastructure runs on executables that are in place in
  the staging directory, rather than in the sandbox. This should be more
  hygienic and realistic.

- The `Cryptol.cry` prelude file is now in `/share/cryptol` in order to
  better reflect the common POSIX structure. This means Cryptol will
  play nicer in global installs, and mirrors what other interpreted
  languages do.

- The default build settings use a prefix of `/usr/local` rather than
  using the sandbox directory. This makes them more relocatable for
  binary distributions. Set PREFIX= before making to change this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty module is a parser error
2 participants