From 3689caa1fc5106c9b247738e4fd1b9d9a9f59abe Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 11 Apr 2022 01:08:54 -0400 Subject: [PATCH] finally nailed the triggers! (I hope) --- .github/workflows/ci.yml | 4 +-- .../src/rescript/OldParser/Parser.res | 31 ++++++------------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c9b3a21..67c3a37c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: name: Language lint runs-on: ubuntu-latest needs: pre_check - if: ${{ !needs.pre_check.outputs.should_skip_lang }} + if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} defaults: run: shell: bash @@ -91,7 +91,7 @@ jobs: name: Website build runs-on: ubuntu-latest needs: pre_check - if: ${{ !(needs.pre_check.outputs.should_skip_website && needs.pre_check.outputs.should_skip_lang && needs.pre_check.outputs.should_skip_components) }} + if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} defaults: run: shell: bash diff --git a/packages/squiggle-lang/src/rescript/OldParser/Parser.res b/packages/squiggle-lang/src/rescript/OldParser/Parser.res index 6f5fd9ef..8a5e4390 100644 --- a/packages/squiggle-lang/src/rescript/OldParser/Parser.res +++ b/packages/squiggle-lang/src/rescript/OldParser/Parser.res @@ -121,17 +121,14 @@ module MathAdtToDistDst = { | (_, _, Ok(mu), Ok(sigma)) => Ok(#FunctionCall("lognormal", [mu, sigma])) | _ => Error("Lognormal distribution needs either mean and stdev or mu and sigma") } - | _ => - parseArgs() |> E.R.fmap((args: array) => - #FunctionCall("lognormal", args) - ) + | _ => parseArgs() |> E.R.fmap((args: array) => #FunctionCall("lognormal", args)) } // Error("Dotwise exponentiation needs two operands") - let operationParser = ( - name: string, - args: result, string>, - ): result => { + let operationParser = (name: string, args: result, string>): result< + ASTTypes.node, + string, + > => { let toOkAlgebraic = r => Ok(#AlgebraicCombination(r)) let toOkPointwise = r => Ok(#PointwiseCombination(r)) let toOkTruncate = r => Ok(#Truncate(r)) @@ -169,10 +166,7 @@ module MathAdtToDistDst = { } let functionParser = ( - nodeParser: MathJsonToMathJsAdt.arg => Belt.Result.t< - ASTTypes.node, - string, - >, + nodeParser: MathJsonToMathJsAdt.arg => Belt.Result.t, name: string, args: array, ): result => { @@ -224,17 +218,11 @@ module MathAdtToDistDst = { ) Ok(hash) } - | name => - parseArgs() |> E.R.fmap((args: array) => - #FunctionCall(name, args) - ) + | name => parseArgs() |> E.R.fmap((args: array) => #FunctionCall(name, args)) } } - let rec nodeParser: MathJsonToMathJsAdt.arg => result< - ASTTypes.node, - string, - > = x => + let rec nodeParser: MathJsonToMathJsAdt.arg => result = x => switch x { | Value(f) => Ok(#SymbolicDist(#Float(f))) | Symbol(sym) => Ok(#Symbol(sym)) @@ -267,8 +255,7 @@ module MathAdtToDistDst = { blocks |> E.A.fmap(b => topLevel(b)) |> E.A.R.firstErrorOrOpen |> E.R.fmap(E.A.concatMany) } - let run = (r): result => - r |> MathAdtCleaner.run |> topLevel + let run = (r): result => r |> MathAdtCleaner.run |> topLevel } /* The MathJs parser doesn't support '.+' syntax, but we want it because it