GrammaticalFramework / gf-core

Grammatical Framework core: compiler, shell & runtimes
https://www.grammaticalframework.org
Other
131 stars 35 forks source link

Fix syntax error problem for older versions of GHC #78

Closed anka-213 closed 4 years ago

anka-213 commented 4 years ago

This problem was introduced in #71

As reported by @inariksit:

Symptom 1: Command line parameters not recognised, e.g.

$ gf
i -retain prelude/Prelude.gfo
cc -all ss "hello"
syntax error

It should work like this:

i -retain prelude/Prelude.gfo
cc -all ss "hello"
hello

Symptom 2: error messages don't include line numbers. Example:

$ gf Foo.gf <some grammar with syntax errors>
- compiling Foo.gf... gf: syntax error

Expected:

$ gf Foo.gf <some grammar with syntax errors>
- compiling Foogf... 

Foo.gf:381:21:
   syntax error

Here is a script that I used for testing for symptom 1:

stackFile=stack.yaml

stack build --stack-yaml $stackFile  --ghc-options -j || exit 125

echo -e 'i -retain prelude/Prelude.gfo\ncc -all ss "hello"' |  GF_LIB_PATH=../gf-rgl/result/rgl/ stack --stack-yaml $stackFile $nixFlag run gf
echo -e 'i -retain prelude/Prelude.gfo\ncc -all ss "hello"' |  GF_LIB_PATH=../gf-rgl/result/rgl/ stack --stack-yaml $stackFile $nixFlag run gf | grep "hello" || exit 1
anka-213 commented 4 years ago

The python build error is unrelated to this change. I've reported the problem upstream: https://github.com/joerick/cibuildwheel/issues/446

johnjcamilleri commented 4 years ago

Confirmed bug and fix, looks good to me!

anka-213 commented 4 years ago

Oh, the new version of cibuildwheel is released now, so we can replace the git reference with an explicit version number now: https://github.com/joerick/cibuildwheel/releases/tag/v1.6.2