Skip to content

Commit

Permalink
Switch bundled Elm compiler to elm-syntax version 7.3.7
Browse files Browse the repository at this point in the history
Switch to the newer, faster implementation for parsing Elm module texts into syntax trees.
  • Loading branch information
Viir committed Nov 30, 2024
1 parent 8af646f commit d99bf5a
Show file tree
Hide file tree
Showing 63 changed files with 8,614 additions and 3,316 deletions.
6 changes: 3 additions & 3 deletions implement/Pine.Core/Pine.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AssemblyVersion>0.3.25</AssemblyVersion>
<FileVersion>0.3.25</FileVersion>
<AssemblyVersion>0.3.26</AssemblyVersion>
<FileVersion>0.3.26</FileVersion>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>

<PropertyGroup>
<PackageId>Pine.Core</PackageId>
<Version>0.3.25</Version>
<Version>0.3.26</Version>
<Description>The cross-platform Elm runtime environment</Description>
<PackageTags>Functional;Elm;Runtime;Compiler;VM;DBMS</PackageTags>
<RepositoryUrl>https://github.com/pine-vm/pine.git</RepositoryUrl>
Expand Down
11 changes: 11 additions & 0 deletions implement/Pine.Core/PopularValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,17 @@ from c2 in Enumerable.Range(0, 128)
"(|.)",
"|=",
"|.",


"PStep",
"Good",
"Bad",
"PState",
"WithComments",
"Rope",
"Leaf",
"Branch2",

];

public static IEnumerable<ElmValue> PopularElmValuesSource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CompilationInterface.ElmMake exposing (..)
{-| For documentation of the compilation interface, see <https://github.com/pine-vm/pine/blob/main/guide/how-to-use-elm-compilation-interfaces.md#compilationinterfaceelmmake-elm-module>
-}

import Basics


elm_make____src_Frontend_Main_elm : { debug : { base64 : String } }
elm_make____src_Frontend_Main_elm =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CompilationInterface.ElmMake exposing (..)
{-| For documentation of the compilation interface, see <https://github.com/pine-vm/pine/blob/main/guide/how-to-use-elm-compilation-interfaces.md#compilationinterfaceelmmake-elm-module>
-}

import Basics


elm_make____src_Frontend_Main_elm : { debug : { base64 : String } }
elm_make____src_Frontend_Main_elm =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CompilationInterface.SourceFiles exposing (..)
{-| For documentation of the compilation interface, see <https://github.com/pine-vm/pine/blob/main/guide/how-to-use-elm-compilation-interfaces.md#compilationinterfacesourcefiles-elm-module>
-}

import Basics


file____README_md : { utf8 : String }
file____README_md =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CompilationInterface.ElmMake exposing (..)
{-| For documentation of the compilation interface, see <https://github.com/pine-vm/pine/blob/main/guide/how-to-use-elm-compilation-interfaces.md#compilationinterfaceelmmake-elm-module>
-}

import Basics


elm_make____src_Frontend_Main_elm : { debug : { javascript : { base64 : String } }, javascript : { base64 : String } }
elm_make____src_Frontend_Main_elm =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CompilationInterface.ElmMake exposing (..)
{-| For documentation of the compilation interface, see <https://github.com/pine-vm/pine/blob/main/guide/how-to-use-elm-compilation-interfaces.md#compilationinterfaceelmmake-elm-module>
-}

import Basics


elm_make____src_Frontend_Main_elm : { debug : { gzip : { base64 : String } }, gzip : { base64 : String } }
elm_make____src_Frontend_Main_elm =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module CompilationInterface.ElmMake exposing (..)
{-| For documentation of the compilation interface, see <https://github.com/pine-vm/pine/blob/main/guide/how-to-use-elm-compilation-interfaces.md#compilationinterfaceelmmake-elm-module>
-}

import Basics


elm_make____src_Frontend_Main_elm : { base64 : String, debug : { base64 : String } }
elm_make____src_Frontend_Main_elm =
Expand Down
192 changes: 118 additions & 74 deletions implement/pine/Elm/elm-compiler/elm-kernel-modules/Json/Decode.elm
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,20 @@ map4 :
-> Decoder d
-> Decoder value
map4 func decoderA decoderB decoderC decoderD jsonValue =
case ( decoderA jsonValue, decoderB jsonValue, decoderC jsonValue, decoderD jsonValue ) of
( Ok a, Ok b, Ok c, Ok d ) ->
case ( ( decoderA jsonValue, decoderB jsonValue ), ( decoderC jsonValue, decoderD jsonValue ) ) of
( ( Ok a, Ok b ), ( Ok c, Ok d ) ) ->
Ok (func a b c d)

( Err err, _, _, _ ) ->
( ( Err err, _ ), _ ) ->
Err err

( _, Err err, _, _ ) ->
( ( _, Err err ), _ ) ->
Err err

( _, _, Err err, _ ) ->
( _, ( Err err, _ ) ) ->
Err err

( _, _, _, Err err ) ->
( _, ( _, Err err ) ) ->
Err err


Expand All @@ -246,24 +246,32 @@ map5 :
-> Decoder e
-> Decoder value
map5 func decoderA decoderB decoderC decoderD decoderE jsonValue =
case ( decoderA jsonValue, decoderB jsonValue, decoderC jsonValue, decoderD jsonValue, decoderE jsonValue ) of
( Ok a, Ok b, Ok c, Ok d, Ok e ) ->
Ok (func a b c d e)

( Err err, _, _, _, _ ) ->
case decoderA jsonValue of
Err err ->
Err err

( _, Err err, _, _, _ ) ->
Err err
Ok a ->
case decoderB jsonValue of
Err err ->
Err err

( _, _, Err err, _, _ ) ->
Err err
Ok b ->
case decoderC jsonValue of
Err err ->
Err err

( _, _, _, Err err, _ ) ->
Err err
Ok c ->
case decoderD jsonValue of
Err err ->
Err err

( _, _, _, _, Err err ) ->
Err err
Ok d ->
case decoderE jsonValue of
Err err ->
Err err

Ok e ->
Ok (func a b c d e)


map6 :
Expand All @@ -276,27 +284,37 @@ map6 :
-> Decoder f
-> Decoder value
map6 func decoderA decoderB decoderC decoderD decoderE decoderF jsonValue =
case ( decoderA jsonValue, decoderB jsonValue, decoderC jsonValue, decoderD jsonValue, decoderE jsonValue, decoderF jsonValue ) of
( Ok a, Ok b, Ok c, Ok d, Ok e, Ok f ) ->
Ok (func a b c d e f)

( Err err, _, _, _, _, _ ) ->
case decoderA jsonValue of
Err err ->
Err err

( _, Err err, _, _, _, _ ) ->
Err err
Ok a ->
case decoderB jsonValue of
Err err ->
Err err

( _, _, Err err, _, _, _ ) ->
Err err
Ok b ->
case decoderC jsonValue of
Err err ->
Err err

( _, _, _, Err err, _, _ ) ->
Err err
Ok c ->
case decoderD jsonValue of
Err err ->
Err err

( _, _, _, _, Err err, _ ) ->
Err err
Ok d ->
case decoderE jsonValue of
Err err ->
Err err

( _, _, _, _, _, Err err ) ->
Err err
Ok e ->
case decoderF jsonValue of
Err err ->
Err err

Ok f ->
Ok (func a b c d e f)


map7 :
Expand All @@ -310,30 +328,42 @@ map7 :
-> Decoder g
-> Decoder value
map7 func decoderA decoderB decoderC decoderD decoderE decoderF decoderG jsonValue =
case ( decoderA jsonValue, decoderB jsonValue, decoderC jsonValue, decoderD jsonValue, decoderE jsonValue, decoderF jsonValue, decoderG jsonValue ) of
( Ok a, Ok b, Ok c, Ok d, Ok e, Ok f, Ok g ) ->
Ok (func a b c d e f g)

( Err err, _, _, _, _, _, _ ) ->
case decoderA jsonValue of
Err err ->
Err err

( _, Err err, _, _, _, _, _ ) ->
Err err
Ok a ->
case decoderB jsonValue of
Err err ->
Err err

( _, _, Err err, _, _, _, _ ) ->
Err err
Ok b ->
case decoderC jsonValue of
Err err ->
Err err

( _, _, _, Err err, _, _, _ ) ->
Err err
Ok c ->
case decoderD jsonValue of
Err err ->
Err err

( _, _, _, _, Err err, _, _ ) ->
Err err
Ok d ->
case decoderE jsonValue of
Err err ->
Err err

( _, _, _, _, _, Err err, _ ) ->
Err err
Ok e ->
case decoderF jsonValue of
Err err ->
Err err

( _, _, _, _, _, _, Err err ) ->
Err err
Ok f ->
case decoderG jsonValue of
Err err ->
Err err

Ok g ->
Ok (func a b c d e f g)


map8 :
Expand All @@ -348,33 +378,47 @@ map8 :
-> Decoder h
-> Decoder value
map8 func decoderA decoderB decoderC decoderD decoderE decoderF decoderG decoderH jsonValue =
case ( decoderA jsonValue, decoderB jsonValue, decoderC jsonValue, decoderD jsonValue, decoderE jsonValue, decoderF jsonValue, decoderG jsonValue, decoderH jsonValue ) of
( Ok a, Ok b, Ok c, Ok d, Ok e, Ok f, Ok g, Ok h ) ->
Ok (func a b c d e f g h)

( Err err, _, _, _, _, _, _, _ ) ->
Err err

( _, Err err, _, _, _, _, _, _ ) ->
Err err

( _, _, Err err, _, _, _, _, _ ) ->
Err err

( _, _, _, Err err, _, _, _, _ ) ->
Err err

( _, _, _, _, Err err, _, _, _ ) ->
case decoderA jsonValue of
Err err ->
Err err

( _, _, _, _, _, Err err, _, _ ) ->
Err err
Ok a ->
case decoderB jsonValue of
Err err ->
Err err

( _, _, _, _, _, _, Err err, _ ) ->
Err err
Ok b ->
case decoderC jsonValue of
Err err ->
Err err

( _, _, _, _, _, _, _, Err err ) ->
Err err
Ok c ->
case decoderD jsonValue of
Err err ->
Err err

Ok d ->
case decoderE jsonValue of
Err err ->
Err err

Ok e ->
case decoderF jsonValue of
Err err ->
Err err

Ok f ->
case decoderG jsonValue of
Err err ->
Err err

Ok g ->
case decoderH jsonValue of
Err err ->
Err err

Ok h ->
Ok (func a b c d e f g h)


andThen : (a -> Decoder b) -> Decoder a -> Decoder b
Expand Down
Loading

0 comments on commit d99bf5a

Please sign in to comment.