diff --git a/.github/workflows/build-all-versions.yml b/.github/workflows/build-all-versions.yml index 2bd856b7c..4dffba3c1 100644 --- a/.github/workflows/build-all-versions.yml +++ b/.github/workflows/build-all-versions.yml @@ -12,6 +12,7 @@ jobs: name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] cabal: ["latest"] @@ -19,21 +20,26 @@ jobs: - "8.6.5" - "8.8.3" - "8.10.7" + - "9.6.7" exclude: - os: macos-latest ghc: 8.8.3 - os: macos-latest ghc: 8.6.5 + - os: macos-latest + ghc: 8.10.7 - os: windows-latest ghc: 8.8.3 - os: windows-latest ghc: 8.6.5 + - os: windows-latest + ghc: 8.10.7 steps: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 id: setup-haskell-cabal name: Setup Haskell with: @@ -44,7 +50,7 @@ jobs: run: | cabal freeze - - uses: actions/cache@v1 + - uses: actions/cache@v4 name: Cache ~/.cabal/store with: path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} @@ -64,16 +70,16 @@ jobs: name: stack / ghc ${{ matrix.ghc }} runs-on: ${{ matrix.ghc == '7.10.3' && 'ubuntu-20.04' || 'ubuntu-latest' }} strategy: + fail-fast: false matrix: stack: ["latest"] - ghc: ["7.10.3","8.0.2", "8.2.2", "8.4.4", "8.6.5", "8.8.4", "8.10.7", "9.0.2"] - # ghc: ["8.8.3"] + ghc: ["8.4.4", "8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.6.7"] steps: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 name: Setup Haskell Stack with: ghc-version: ${{ matrix.ghc }} @@ -85,7 +91,7 @@ jobs: - run: sed -i.bak 's/"C compiler link flags", "/&-no-pie /' /home/runner/.ghcup/ghc/7.10.3/lib/ghc-7.10.3/settings if: matrix.ghc == '7.10.3' - - uses: actions/cache@v1 + - uses: actions/cache@v4 name: Cache ~/.stack with: path: ~/.stack diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 5e484bdd0..d7d8ac94a 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 name: Install Python with: python-version: '3.x' @@ -31,6 +31,7 @@ jobs: if: startsWith(matrix.os, 'macos') run: | brew install automake + brew install libtool - name: Build wheels on Linux if: startsWith(matrix.os, 'macos') != true @@ -42,12 +43,13 @@ jobs: - name: Build wheels on OSX if: startsWith(matrix.os, 'macos') env: - CIBW_BEFORE_BUILD: cd src/runtime/c && glibtoolize && autoreconf -i && ./configure && make && make install + CIBW_BEFORE_BUILD: cd src/runtime/c && glibtoolize && autoreconf -i && ./configure && make && sudo make install run: | python -m cibuildwheel src/runtime/python --output-dir wheelhouse - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: + name: wheel-${{ matrix.os }} path: ./wheelhouse build_sdist: @@ -59,13 +61,14 @@ jobs: - uses: actions/setup-python@v2 name: Install Python with: - python-version: '3.x' + python-version: '3.10' - name: Build sdist run: cd src/runtime/python && python setup.py sdist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: + name: wheel-source path: ./src/runtime/python/dist/*.tar.gz upload_pypi: @@ -78,16 +81,17 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install twine run: pip install twine - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4.1.7 with: - name: artifact + pattern: wheel-* + merge-multiple: true path: ./dist - name: Publish diff --git a/doc/gf-editor-modes.md b/doc/gf-editor-modes.md new file mode 100644 index 000000000..5351895e0 --- /dev/null +++ b/doc/gf-editor-modes.md @@ -0,0 +1,75 @@ +# Editor modes & IDE integration for GF + +We collect GF modes for various editors on this page. Contributions are welcome! + +## Emacs + +[gf.el](https://github.com/GrammaticalFramework/gf-emacs-mode) by Johan +BockgÃ¥rd provides syntax highlighting and automatic indentation and +lets you run the GF Shell in an emacs buffer. See installation +instructions inside. + +## Atom + +[language-gf](https://atom.io/packages/language-gf), by John J. Camilleri + +## Visual Studio Code + +* [Grammatical Framework Language Server](https://marketplace.visualstudio.com/items?itemName=anka-213.gf-vscode) by Andreas Källberg. +This provides syntax highlighting and a client for the Grammatical Framework language server. Follow the installation instructions in the link. +* [Grammatical Framework](https://marketplace.visualstudio.com/items?itemName=GrammaticalFramework.gf-vscode) is a simpler extension +without any external dependencies which provides only syntax highlighting. + +## Eclipse + +[GF Eclipse Plugin](https://github.com/GrammaticalFramework/gf-eclipse-plugin/), by John J. Camilleri + +## Gedit + +By John J. Camilleri + +Copy the file below to +`~/.local/share/gtksourceview-3.0/language-specs/gf.lang` (under Ubuntu). + + * [gf.lang](../src/tools/gf.lang) + +Some helpful notes/links: + + * The code is based heavily on the `haskell.lang` file which I found in +`/usr/share/gtksourceview-2.0/language-specs/haskell.lang`. + * Ruslan Osmanov recommends +[registering your file extension as its own MIME type](http://osmanov-dev-notes.blogspot.com/2011/04/how-to-add-new-highlight-mode-in-gedit.html) +(see also [here](https://help.ubuntu.com/community/AddingMimeTypes)), +however on my system the `.gf` extension was already registered +as a generic font (`application/x-tex-gf`) and I didn't want to risk +messing any of that up. + * This is a quick 5-minute job and might require some tweaking. +[The GtkSourceView language definition tutorial](http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html) +is the place to start looking. + * Contributions are welcome! + +## Geany + +By John J. Camilleri + +[Custom filetype](http://www.geany.org/manual/dev/index.html#custom-filetypes) +config files for syntax highlighting in [Geany](http://www.geany.org/). + +For version 1.36 and above, copy one of the files below to +`/usr/share/geany/filedefs/filetypes.GF.conf` (under Ubuntu). +If you're using a version older than 1.36, copy the file to `/usr/share/geany/filetypes.GF.conf`. +You will need to manually create the file. + + * [light-filetypes.GF.conf](../src/tools/light-filetypes.GF.conf) + * [dark-filetypes.GF.conf](../src/tools/dark-filetypes.GF.conf) + +You will also need to edit the `filetype_extensions.conf` file and add the +following line somewhere: + +``` +GF=*.gf +``` + +## Vim + +[vim-gf](https://github.com/gdetrez/vim-gf) \ No newline at end of file diff --git a/doc/gf-editor-modes.t2t b/doc/gf-editor-modes.t2t deleted file mode 100644 index 4ff15520d..000000000 --- a/doc/gf-editor-modes.t2t +++ /dev/null @@ -1,81 +0,0 @@ -Editor modes & IDE integration for GF - - -We collect GF modes for various editors on this page. Contributions are -welcome! - - -==Emacs== - -[gf.el https://github.com/GrammaticalFramework/gf-emacs-mode] by Johan -BockgÃ¥rd provides syntax highlighting and automatic indentation and -lets you run the GF Shell in an emacs buffer. See installation -instructions inside. - -==Atom== -[language-gf https://atom.io/packages/language-gf], by John J. Camilleri - -==Visual Studio Code== - -- [Grammatical Framework Language Server https://marketplace.visualstudio.com/items?itemName=anka-213.gf-vscode] by Andreas Källberg. - This provides syntax highlighting and a client for the Grammatical Framework language server. Follow the installation instructions in the link. -- [Grammatical Framework https://marketplace.visualstudio.com/items?itemName=GrammaticalFramework.gf-vscode] is a simpler extension - without any external dependencies which provides only syntax highlighting. - -==Eclipse== - -[GF Eclipse Plugin https://github.com/GrammaticalFramework/gf-eclipse-plugin/], by John J. Camilleri - -==Gedit== - -By John J. Camilleri - -Copy the file below to -``~/.local/share/gtksourceview-3.0/language-specs/gf.lang`` (under Ubuntu). - -- [gf.lang ../src/tools/gf.lang] - - -Some helpful notes/links: - -- The code is based heavily on the ``haskell.lang`` file which I found in - ``/usr/share/gtksourceview-2.0/language-specs/haskell.lang``. -- Ruslan Osmanov recommends - [registering your file extension as its own MIME type http://osmanov-dev-notes.blogspot.com/2011/04/how-to-add-new-highlight-mode-in-gedit.html] - (see also [here https://help.ubuntu.com/community/AddingMimeTypes]), - however on my system the ``.gf`` extension was already registered - as a generic font (``application/x-tex-gf``) and I didn't want to risk - messing any of that up. -- This is a quick 5-minute job and might require some tweaking. - [The GtkSourceView language definition tutorial http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html] - is the place to start looking. -- Contributions are welcome! - - -==Geany== - -By John J. Camilleri - -[Custom filetype http://www.geany.org/manual/dev/index.html#custom-filetypes] -config files for syntax highlighting in [Geany http://www.geany.org/]. - -For version 1.36 and above, copy one of the files below to -``/usr/share/geany/filedefs/filetypes.GF.conf`` (under Ubuntu). -If you're using a version older than 1.36, copy the file to ``/usr/share/geany/filetypes.GF.conf``. -You will need to manually create the file. - -- [light-filetypes.GF.conf ../src/tools/light-filetypes.GF.conf] -- [dark-filetypes.GF.conf ../src/tools/dark-filetypes.GF.conf] - - -You will also need to edit the ``filetype_extensions.conf`` file and add the -following line somewhere: - -``` -GF=*.gf -``` - - -==Vim== - -[vim-gf https://github.com/gdetrez/vim-gf] diff --git a/doc/tutorial/gf-tutorial.t2t b/doc/tutorial/gf-tutorial.t2t index 2c8d909de..c4ccb6aab 100644 --- a/doc/tutorial/gf-tutorial.t2t +++ b/doc/tutorial/gf-tutorial.t2t @@ -1265,10 +1265,16 @@ Human eye may prefer to see a visualization: ``visualize_tree = vt``: > parse "this delicious cheese is very Italian" | visualize_tree ``` The tree is generated in postscript (``.ps``) file. The ``-view`` option is used for -telling what command to use to view the file. Its default is ``"open"``, which works -on Mac OS X. On Ubuntu Linux, one can write +telling what command to use to view the file. + +This works on Mac OS X: ``` - > parse "this delicious cheese is very Italian" | visualize_tree -view="eog" + > parse "this delicious cheese is very Italian" | visualize_tree -view=open +``` +On Linux, one can use one of the following commands. +``` + > parse "this delicious cheese is very Italian" | visualize_tree -view=eog + > parse "this delicious cheese is very Italian" | visualize_tree -view=xdg-open ``` @@ -1733,6 +1739,13 @@ A new module can **extend** an old one: Pizza : Kind ; } ``` +Note that the extended grammar doesn't inherit the start +category from the grammar it extends, so if you want to +generate sentences with this grammar, you'll have to either +add a startcat (e.g. ``flags startcat = Question ;``), +or in the GF shell, specify the category to ``generate_random`` or ``geneate_trees`` +(e.g. ``gr -cat=Comment`` or ``gt -cat=Question``). + Parallel to the abstract syntax, extensions can be built for concrete syntaxes: ``` diff --git a/download/index-3.11.md b/download/index-3.11.md index 8fa1d5c02..c557de022 100644 --- a/download/index-3.11.md +++ b/download/index-3.11.md @@ -139,6 +139,8 @@ stack install For more info on working with the GF source code, see the [GF Developers Guide](../doc/gf-developers.html). +For macOS Sequoia, you need to downgrade the LLVM package, see instructions [here](https://github.com/GrammaticalFramework/gf-core/issues/172#issuecomment-2599365457). + ## Installing the Python bindings from PyPI The Python library is available on PyPI as `pgf`, so it can be installed using: diff --git a/gf-book/examples/chapter2/FoodIta.gf b/gf-book/examples/chapter2/FoodIta.gf index 466104432..a50925dcf 100644 --- a/gf-book/examples/chapter2/FoodIta.gf +++ b/gf-book/examples/chapter2/FoodIta.gf @@ -2,7 +2,7 @@ concrete FoodIta of Food = { lincat Comment, Item, Kind, Quality = Str ; lin - Pred item quality = item ++ "è" ++ quality ; + Pred item quality = item ++ "è" ++ quality ; This kind = "questo" ++ kind ; That kind = "quel" ++ kind ; Mod quality kind = kind ++ quality ; diff --git a/gf-book/examples/chapter3/ResIta.gf b/gf-book/examples/chapter3/ResIta.gf index 17809c498..77188198c 100644 --- a/gf-book/examples/chapter3/ResIta.gf +++ b/gf-book/examples/chapter3/ResIta.gf @@ -32,5 +32,5 @@ resource ResIta = open Prelude in { in adjective nero (ner+"a") (ner+"i") (ner+"e") ; copula : Number => Str = - table {Sg => "è" ; Pl => "sono"} ; + table {Sg => "è" ; Pl => "sono"} ; } diff --git a/gf-book/examples/chapter5/LexFoodsFin.gf b/gf-book/examples/chapter5/LexFoodsFin.gf index 4cf26511a..1f8dfd030 100644 --- a/gf-book/examples/chapter5/LexFoodsFin.gf +++ b/gf-book/examples/chapter5/LexFoodsFin.gf @@ -8,13 +8,13 @@ instance LexFoodsFin of LexFoods = cheese_N = mkN "juusto" ; fish_N = mkN "kala" ; fresh_A = mkA "tuore" ; - warm_A = mkA - (mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään" - "lämpiminä" "lämpimiä" "lämpimien" "lämpimissä" "lämpimiin" - ) - "lämpimämpi" "lämpimin" ; + warm_A = mkA + (mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään" + "lämpiminä" "lämpimiä" "lämpimien" "lämpimissä" "lämpimiin" + ) + "lämpimämpi" "lämpimin" ; italian_A = mkA "italialainen" ; expensive_A = mkA "kallis" ; delicious_A = mkA "herkullinen" ; - boring_A = mkA "tylsä" ; + boring_A = mkA "tylsä" ; } diff --git a/gf-book/examples/chapter5/LexFoodsGer.gf b/gf-book/examples/chapter5/LexFoodsGer.gf index a420e22d3..a1791172a 100644 --- a/gf-book/examples/chapter5/LexFoodsGer.gf +++ b/gf-book/examples/chapter5/LexFoodsGer.gf @@ -1,16 +1,16 @@ -- (c) 2009 Aarne Ranta under LGPL -instance LexFoodsGer of LexFoods = +instance LexFoodsGer of LexFoods = open SyntaxGer, ParadigmsGer in { oper wine_N = mkN "Wein" ; pizza_N = mkN "Pizza" "Pizzen" feminine ; - cheese_N = mkN "Käse" "Käse" masculine ; + cheese_N = mkN "Käse" "Käse" masculine ; fish_N = mkN "Fisch" ; fresh_A = mkA "frisch" ; - warm_A = mkA "warm" "wärmer" "wärmste" ; + warm_A = mkA "warm" "wärmer" "wärmste" ; italian_A = mkA "italienisch" ; expensive_A = mkA "teuer" ; - delicious_A = mkA "köstlich" ; + delicious_A = mkA "köstlich" ; boring_A = mkA "langweilig" ; } diff --git a/gf-book/examples/chapter5/LexFoodsSwe.gf b/gf-book/examples/chapter5/LexFoodsSwe.gf index 72e7e3e86..e9cac00d8 100644 --- a/gf-book/examples/chapter5/LexFoodsSwe.gf +++ b/gf-book/examples/chapter5/LexFoodsSwe.gf @@ -7,10 +7,10 @@ instance LexFoodsSwe of LexFoods = pizza_N = mkN "pizza" ; cheese_N = mkN "ost" ; fish_N = mkN "fisk" ; - fresh_A = mkA "färsk" ; + fresh_A = mkA "färsk" ; warm_A = mkA "varm" ; italian_A = mkA "italiensk" ; expensive_A = mkA "dyr" ; - delicious_A = mkA "läcker" ; - boring_A = mkA "tråkig" ; + delicious_A = mkA "läcker" ; + boring_A = mkA "trÃ¥kig" ; } diff --git a/gf-book/examples/chapter7/QueryFin.gf b/gf-book/examples/chapter7/QueryFin.gf index b3461e34a..03490ae88 100644 --- a/gf-book/examples/chapter7/QueryFin.gf +++ b/gf-book/examples/chapter7/QueryFin.gf @@ -6,7 +6,7 @@ concrete QueryFin of Query = { Odd = pred "pariton" ; Prime = pred "alkuluku" ; Number i = i.s ; - Yes = "kyllä" ; + Yes = "kyllä" ; No = "ei" ; oper pred : Str -> Str -> Str = \f,x -> "onko" ++ x ++ f ; diff --git a/gf-book/examples/chapter9/ResIta.gf b/gf-book/examples/chapter9/ResIta.gf index f39db69f9..28d7bc424 100644 --- a/gf-book/examples/chapter9/ResIta.gf +++ b/gf-book/examples/chapter9/ResIta.gf @@ -43,10 +43,10 @@ oper } ; auxVerb : Aux -> Verb = \a -> case a of { - Avere => + Avere => mkVerb "avere" "ho" "hai" "ha" "abbiamo" "avete" "hanno" "avuto" Avere ; - Essere => - mkVerb "essere" "sono" "sei" "è" "siamo" "siete" "sono" "stato" Essere + Essere => + mkVerb "essere" "sono" "sei" "è" "siamo" "siete" "sono" "stato" Essere } ; agrPart : Verb -> Agr -> ClitAgr -> Str = \v,a,c -> case v.aux of { diff --git a/gf.cabal b/gf.cabal index b5a895f2b..ce0682d46 100644 --- a/gf.cabal +++ b/gf.cabal @@ -73,12 +73,12 @@ library build-depends: -- GHC 8.0.2 to GHC 8.10.4 array >= 0.5.1 && < 0.6, - base >= 4.9.1 && < 4.18, + base >= 4.9.1 && < 4.22, bytestring >= 0.10.8 && < 0.12, containers >= 0.5.7 && < 0.7, exceptions >= 0.8.3 && < 0.11, - ghc-prim >= 0.5.0 && < 0.9.0, - mtl >= 2.2.1 && < 2.3, + ghc-prim >= 0.5.0 && <= 0.10.0, + mtl >= 2.2.1 && <= 2.3.1, pretty >= 1.1.3 && < 1.2, random >= 1.1 && < 1.3, utf8-string >= 1.0.1.1 && < 1.1 @@ -155,10 +155,10 @@ library directory >= 1.3.0 && < 1.4, filepath >= 1.4.1 && < 1.5, haskeline >= 0.7.3 && < 0.9, - json >= 0.9.1 && < 0.11, + json >= 0.9.1 && <= 0.11, parallel >= 3.2.1.1 && < 3.3, process >= 1.4.3 && < 1.7, - time >= 1.6.0 && < 1.10 + time >= 1.6.0 && <= 1.12.2 hs-source-dirs: src/compiler exposed-modules: @@ -346,8 +346,14 @@ library Win32 >= 2.3.1.1 && < 2.7 else build-depends: - terminfo >=0.4.0 && < 0.5, - unix >= 2.7.2 && < 2.8 + terminfo >=0.4.0 && < 0.5 + + if impl(ghc >= 9.6.6) + build-depends: unix >= 2.8 + + else + build-depends: unix >= 2.7.2 && < 2.8 + if impl(ghc>=8.2) ghc-options: -fhide-source-paths @@ -392,7 +398,7 @@ test-suite gf-tests main-is: run.hs hs-source-dirs: testsuite build-depends: - base >= 4.9.1 && < 4.16, + base >= 4.9.1, Cabal >= 1.8, directory >= 1.3.0 && < 1.4, filepath >= 1.4.1 && < 1.5, diff --git a/index.html b/index.html index dd252ec94..214d8c66f 100644 --- a/index.html +++ b/index.html @@ -87,11 +87,6 @@

Contribute