diff --git a/.github/workflows/ghc.yml b/.github/workflows/ghc.yml index b3f835862..b53026bda 100644 --- a/.github/workflows/ghc.yml +++ b/.github/workflows/ghc.yml @@ -24,7 +24,7 @@ jobs: steps: - name: 📥 Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 🧰 Setup Stack uses: freckle/stack-action@v4 @@ -39,7 +39,7 @@ jobs: steps: - name: 📥 Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 🧰 Setup Stack uses: freckle/stack-action@v4 diff --git a/eo-phi-normalizer/grammar/EO/Phi/Syntax.cf b/eo-phi-normalizer/grammar/EO/Phi/Syntax.cf index 1ba2696af..12842f2d0 100644 --- a/eo-phi-normalizer/grammar/EO/Phi/Syntax.cf +++ b/eo-phi-normalizer/grammar/EO/Phi/Syntax.cf @@ -14,8 +14,8 @@ token AlphaIndex ({"α0"} | {"α"} (digit - ["0"]) (digit)* ) ; Program. Program ::= "{" [Binding] "}" ; -Formation. Object ::= "{" [Binding] "}" ; -Application. Object ::= Object "{" [Binding] "}" ; +Formation. Object ::= "⟦" [Binding] "⟧" ; +Application. Object ::= Object "(" [Binding] ")" ; ObjectDispatch. Object ::= Object "." Attribute ; GlobalDispatch. Object ::= "Φ" "." Attribute ; ThisDispatch. Object ::= "ξ" "." Attribute ; diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Doc.txt b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Doc.txt index 6e5dd3b6c..59806e5b7 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Doc.txt +++ b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Doc.txt @@ -1,86 +1,89 @@ -The Language Syntax -BNF Converter - - -%Process by txt2tags to generate html or latex - - - -This document was automatically generated by the //BNF-Converter//. It was generated together with the lexer, the parser, and the abstract syntax module, which guarantees that the document matches with the implementation of the language (provided no hand-hacking has taken place). - -==The lexical structure of Syntax== - -===Literals=== - - - - - -Bytes literals are recognized by the regular expression -`````{"--"} | ["0123456789ABCDEF"] ["0123456789ABCDEF"] '-' | (["0123456789ABCDEF"] ["0123456789ABCDEF"] '-' ["0123456789ABCDEF"] ["0123456789ABCDEF"])+````` - -Function literals are recognized by the regular expression -`````upper (char - [" - !'(),-.:;?[]{|}⟦⟧"])*````` - -LabelId literals are recognized by the regular expression -`````lower (char - [" - !'(),-.:;?[]{|}⟦⟧"])*````` - -AlphaIndex literals are recognized by the regular expression -`````{"α0"} | 'α' (digit - '0') digit*````` - - -===Reserved words and symbols=== -The set of reserved words is the set of terminals appearing in the grammar. Those reserved words that consist of non-letter characters are called symbols, and they are treated in a different way from those that are similar to identifiers. The lexer follows rules familiar from languages like Haskell, C, and Java, including longest match and spacing conventions. - -The reserved words used in Syntax are the following: - | ``Δ`` | ``Φ`` | ``λ`` | ``ν`` - | ``ξ`` | ``ρ`` | ``σ`` | ``φ`` - -The symbols used in Syntax are the following: - | { | } | . | ⊥ - | ↦ | ∅ | ⤍ | , - -===Comments=== -There are no single-line comments in the grammar.There are no multiple-line comments in the grammar. - -==The syntactic structure of Syntax== -Non-terminals are enclosed between < and >. -The symbols -> (production), **|** (union) -and **eps** (empty rule) belong to the BNF notation. -All other symbols are terminals. - - | //Program// | -> | ``{`` //[Binding]// ``}`` - | //Object// | -> | ``{`` //[Binding]// ``}`` - | | **|** | //Object// ``{`` //[Binding]// ``}`` - | | **|** | //Object// ``.`` //Attribute// - | | **|** | ``Φ`` ``.`` //Attribute// - | | **|** | ``ξ`` ``.`` //Attribute// - | | **|** | ``⊥`` - | //Binding// | -> | //Attribute// ``↦`` //Object// - | | **|** | //Attribute// ``↦`` ``∅`` - | | **|** | ``Δ`` ``⤍`` //Bytes// - | | **|** | ``λ`` ``⤍`` //Function// - | //[Binding]// | -> | **eps** - | | **|** | //Binding// - | | **|** | //Binding// ``,`` //[Binding]// - | //Attribute// | -> | ``φ`` - | | **|** | ``ρ`` - | | **|** | ``σ`` - | | **|** | ``ν`` - | | **|** | //LabelId// - | | **|** | //AlphaIndex// - | //PeeledObject// | -> | //ObjectHead// //[ObjectAction]// - | //ObjectHead// | -> | ``{`` //[Binding]// ``}`` - | | **|** | ``Φ`` - | | **|** | ``ξ`` - | | **|** | ``⊥`` - | //ObjectAction// | -> | ``{`` //[Binding]// ``}`` - | | **|** | ``.`` //Attribute// - | //[ObjectAction]// | -> | **eps** - | | **|** | //ObjectAction// //[ObjectAction]// - - - -%% File generated by the BNF Converter (bnfc 2.9.6). +The Language Syntax +BNF Converter + + +%Process by txt2tags to generate html or latex + + + +This document was automatically generated by the //BNF-Converter//. It was generated together with the lexer, the parser, and the abstract syntax module, which guarantees that the document matches with the implementation of the language (provided no hand-hacking has taken place). + +==The lexical structure of Syntax== + +===Literals=== + + + + + +Bytes literals are recognized by the regular expression +`````{"--"} | ["0123456789ABCDEF"] ["0123456789ABCDEF"] '-' | (["0123456789ABCDEF"] ["0123456789ABCDEF"] '-' ["0123456789ABCDEF"] ["0123456789ABCDEF"])+````` + +Function literals are recognized by the regular expression +`````upper (char - [" + + !'(),-.:;?[]{|}⟦⟧"])*````` + +LabelId literals are recognized by the regular expression +`````lower (char - [" + + !'(),-.:;?[]{|}⟦⟧"])*````` + +AlphaIndex literals are recognized by the regular expression +`````{"α0"} | 'α' (digit - '0') digit*````` + + +===Reserved words and symbols=== +The set of reserved words is the set of terminals appearing in the grammar. Those reserved words that consist of non-letter characters are called symbols, and they are treated in a different way from those that are similar to identifiers. The lexer follows rules familiar from languages like Haskell, C, and Java, including longest match and spacing conventions. + +The reserved words used in Syntax are the following: + | ``Δ`` | ``Φ`` | ``λ`` | ``ν`` + | ``ξ`` | ``ρ`` | ``σ`` | ``φ`` + +The symbols used in Syntax are the following: + | { | } | ⟦ | ⟧ + | ( | ) | . | ⊥ + | ↦ | ∅ | ⤍ | , + +===Comments=== +There are no single-line comments in the grammar.There are no multiple-line comments in the grammar. + +==The syntactic structure of Syntax== +Non-terminals are enclosed between < and >. +The symbols -> (production), **|** (union) +and **eps** (empty rule) belong to the BNF notation. +All other symbols are terminals. + + | //Program// | -> | ``{`` //[Binding]// ``}`` + | //Object// | -> | ``⟦`` //[Binding]// ``⟧`` + | | **|** | //Object// ``(`` //[Binding]// ``)`` + | | **|** | //Object// ``.`` //Attribute// + | | **|** | ``Φ`` ``.`` //Attribute// + | | **|** | ``ξ`` ``.`` //Attribute// + | | **|** | ``⊥`` + | //Binding// | -> | //Attribute// ``↦`` //Object// + | | **|** | //Attribute// ``↦`` ``∅`` + | | **|** | ``Δ`` ``⤍`` //Bytes// + | | **|** | ``λ`` ``⤍`` //Function// + | //[Binding]// | -> | **eps** + | | **|** | //Binding// + | | **|** | //Binding// ``,`` //[Binding]// + | //Attribute// | -> | ``φ`` + | | **|** | ``ρ`` + | | **|** | ``σ`` + | | **|** | ``ν`` + | | **|** | //LabelId// + | | **|** | //AlphaIndex// + | //PeeledObject// | -> | //ObjectHead// //[ObjectAction]// + | //ObjectHead// | -> | ``{`` //[Binding]// ``}`` + | | **|** | ``Φ`` + | | **|** | ``ξ`` + | | **|** | ``⊥`` + | //ObjectAction// | -> | ``{`` //[Binding]// ``}`` + | | **|** | ``.`` //Attribute// + | //[ObjectAction]// | -> | **eps** + | | **|** | //ObjectAction// //[ObjectAction]// + + + +%% File generated by the BNF Converter (bnfc 2.9.6). diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Lex.x b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Lex.x index bcb8c56a3..9dbbbaf5a 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Lex.x +++ b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Lex.x @@ -28,7 +28,7 @@ $u = [. \n] -- universal: any character -- Symbols and non-identifier-like reserved words -@rsyms = \Φ | \ξ | \Δ | \λ | \φ | \ρ | \σ | \ν | \{ | \} | \. | \⊥ | \↦ | \∅ | \⤍ | \, +@rsyms = \Φ | \ξ | \Δ | \λ | \φ | \ρ | \σ | \ν | \{ | \} | \⟦ | \⟧ | \( | \) | \. | \⊥ | \↦ | \∅ | \⤍ | \, :- @@ -168,13 +168,14 @@ eitherResIdent tv s = treeFind resWords -- | The keywords and symbols of the language organized as binary search tree. resWords :: BTree resWords = - b "\958" 9 - (b "\916" 5 - (b "{" 3 (b "." 2 (b "," 1 N N) N) (b "}" 4 N N)) - (b "\955" 7 (b "\934" 6 N N) (b "\957" 8 N N))) - (b "\8614" 13 - (b "\963" 11 (b "\961" 10 N N) (b "\966" 12 N N)) - (b "\8869" 15 (b "\8709" 14 N N) (b "\10509" 16 N N))) + b "\958" 11 + (b "}" 6 + (b "," 3 (b ")" 2 (b "(" 1 N N) N) (b "{" 5 (b "." 4 N N) N)) + (b "\955" 9 (b "\934" 8 (b "\916" 7 N N) N) (b "\957" 10 N N))) + (b "\8709" 16 + (b "\966" 14 (b "\963" 13 (b "\961" 12 N N) N) (b "\8614" 15 N N)) + (b "\10215" 19 + (b "\10214" 18 (b "\8869" 17 N N) N) (b "\10509" 20 N N))) where b s n = B bs (TS bs n) where diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.y b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.y index 9fe41c67b..1fba42102 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.y +++ b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.y @@ -39,22 +39,26 @@ import Language.EO.Phi.Syntax.Lex %monad { Err } { (>>=) } { return } %tokentype {Token} %token - ',' { PT _ (TS _ 1) } - '.' { PT _ (TS _ 2) } - '{' { PT _ (TS _ 3) } - '}' { PT _ (TS _ 4) } - 'Δ' { PT _ (TS _ 5) } - 'Φ' { PT _ (TS _ 6) } - 'λ' { PT _ (TS _ 7) } - 'ν' { PT _ (TS _ 8) } - 'ξ' { PT _ (TS _ 9) } - 'ρ' { PT _ (TS _ 10) } - 'σ' { PT _ (TS _ 11) } - 'φ' { PT _ (TS _ 12) } - '↦' { PT _ (TS _ 13) } - '∅' { PT _ (TS _ 14) } - '⊥' { PT _ (TS _ 15) } - '⤍' { PT _ (TS _ 16) } + '(' { PT _ (TS _ 1) } + ')' { PT _ (TS _ 2) } + ',' { PT _ (TS _ 3) } + '.' { PT _ (TS _ 4) } + '{' { PT _ (TS _ 5) } + '}' { PT _ (TS _ 6) } + 'Δ' { PT _ (TS _ 7) } + 'Φ' { PT _ (TS _ 8) } + 'λ' { PT _ (TS _ 9) } + 'ν' { PT _ (TS _ 10) } + 'ξ' { PT _ (TS _ 11) } + 'ρ' { PT _ (TS _ 12) } + 'σ' { PT _ (TS _ 13) } + 'φ' { PT _ (TS _ 14) } + '↦' { PT _ (TS _ 15) } + '∅' { PT _ (TS _ 16) } + '⊥' { PT _ (TS _ 17) } + '⟦' { PT _ (TS _ 18) } + '⟧' { PT _ (TS _ 19) } + '⤍' { PT _ (TS _ 20) } L_Bytes { PT _ (T_Bytes $$) } L_Function { PT _ (T_Function $$) } L_LabelId { PT _ (T_LabelId $$) } @@ -80,8 +84,8 @@ Program Object :: { Language.EO.Phi.Syntax.Abs.Object } Object - : '{' ListBinding '}' { Language.EO.Phi.Syntax.Abs.Formation $2 } - | Object '{' ListBinding '}' { Language.EO.Phi.Syntax.Abs.Application $1 $3 } + : '⟦' ListBinding '⟧' { Language.EO.Phi.Syntax.Abs.Formation $2 } + | Object '(' ListBinding ')' { Language.EO.Phi.Syntax.Abs.Application $1 $3 } | Object '.' Attribute { Language.EO.Phi.Syntax.Abs.ObjectDispatch $1 $3 } | 'Φ' '.' Attribute { Language.EO.Phi.Syntax.Abs.GlobalDispatch $3 } | 'ξ' '.' Attribute { Language.EO.Phi.Syntax.Abs.ThisDispatch $3 } diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Print.hs b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Print.hs index cb3eb0312..85cb8cbbc 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Print.hs +++ b/eo-phi-normalizer/src/Language/EO/Phi/Syntax/Print.hs @@ -169,8 +169,8 @@ instance Print Language.EO.Phi.Syntax.Abs.Program where instance Print Language.EO.Phi.Syntax.Abs.Object where prt i = \case - Language.EO.Phi.Syntax.Abs.Formation bindings -> prPrec i 0 (concatD [doc (showString "{"), prt 0 bindings, doc (showString "}")]) - Language.EO.Phi.Syntax.Abs.Application object bindings -> prPrec i 0 (concatD [prt 0 object, doc (showString "{"), prt 0 bindings, doc (showString "}")]) + Language.EO.Phi.Syntax.Abs.Formation bindings -> prPrec i 0 (concatD [doc (showString "\10214"), prt 0 bindings, doc (showString "\10215")]) + Language.EO.Phi.Syntax.Abs.Application object bindings -> prPrec i 0 (concatD [prt 0 object, doc (showString "("), prt 0 bindings, doc (showString ")")]) Language.EO.Phi.Syntax.Abs.ObjectDispatch object attribute -> prPrec i 0 (concatD [prt 0 object, doc (showString "."), prt 0 attribute]) Language.EO.Phi.Syntax.Abs.GlobalDispatch attribute -> prPrec i 0 (concatD [doc (showString "\934"), doc (showString "."), prt 0 attribute]) Language.EO.Phi.Syntax.Abs.ThisDispatch attribute -> prPrec i 0 (concatD [doc (showString "\958"), doc (showString "."), prt 0 attribute]) diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..5db72dd6a --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +}