From 9667ff5511b390c9a5bea1eb9ea73eae27d7cf01 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Oct 2025 00:24:55 +0000 Subject: [PATCH 1/3] Initial plan From 2651cdf13f3d187f531f1e4a73e061d74877c590 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Oct 2025 00:27:04 +0000 Subject: [PATCH 2/3] Initial exploration of repository structure Co-authored-by: ericelliott <364727+ericelliott@users.noreply.github.com> --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 36afb72..29e9bf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sudolang-llm-support", - "version": "2.0.0-rc.1", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sudolang-llm-support", - "version": "2.0.0-rc.1", + "version": "2.0.0", "hasInstallScript": true, "devDependencies": { "@types/node": "14.x", From 4390d150cc1439e5baa5eff7b2b5db3a8c8b1059 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Oct 2025 00:28:49 +0000 Subject: [PATCH 3/3] Add ~> context operator for implicit context binding Co-authored-by: ericelliott <364727+ericelliott@users.noreply.github.com> --- sudolang.sudo.md | 25 +++++++++++++++++++++++++ syntaxes/sudolang.tmLanguage.json | 2 +- syntaxes/syntax-test.sudo | 4 ++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sudolang.sudo.md b/sudolang.sudo.md index 3528c66..5e886c5 100644 --- a/sudolang.sudo.md +++ b/sudolang.sudo.md @@ -149,6 +149,31 @@ h = f |> g; h(20); // 42 ``` +### Context operator `~>` + +The context operator `~>` allows you to use the left-hand context to transform the input on the right. It's similar to `with` statements or binding contexts from functional programming languages. e.g.: + +```SudoLang +PainPoint { + name + description + impact: 1..10 // how much this hurts when it happens + frequency: 1..10 // how often this happens +} + +UserStory { + name + description + painPoint + // The following is equivalent to: + // priority = painPoint.impact * painPoint.frequency + priority = painPoint ~> impact * frequency + functionalRequirements + mockups + phases +} +``` + ### range (inclusive) The range operator `..` can be used to create a range of numbers. e.g.: diff --git a/syntaxes/sudolang.tmLanguage.json b/syntaxes/sudolang.tmLanguage.json index 02796f9..643b835 100644 --- a/syntaxes/sudolang.tmLanguage.json +++ b/syntaxes/sudolang.tmLanguage.json @@ -133,7 +133,7 @@ "patterns": [ { "name": "keyword.operator.sudolang", - "match": "\\+|-|\\*|/|%|\\^|&&|\\|\\||!|<|>|<=|>=|==|!=|\\|>|=|\\+=|-=|\\*=|/=|\\bcap\\b|\\bcup\\b|\\bxor\\b" + "match": "\\+|-|\\*|/|%|\\^|&&|\\|\\||!|<|>|<=|>=|==|!=|~>|\\|>|=|\\+=|-=|\\*=|/=|\\bcap\\b|\\bcup\\b|\\bxor\\b" } ] }, diff --git a/syntaxes/syntax-test.sudo b/syntaxes/syntax-test.sudo index e2aaab6..7cde583 100644 --- a/syntaxes/syntax-test.sudo +++ b/syntaxes/syntax-test.sudo @@ -186,6 +186,10 @@ access = if (age >= 18 && isMember) "granted" else "denied" // Pipe operator for function composition processedData = rawData |> normalize |> filter |> sort +// Context operator for accessing properties with implicit context +painPoint = { impact: 8, frequency: 5 } +priority = painPoint ~> impact * frequency // equivalent to painPoint.impact * painPoint.frequency + ## Disallowed Keywords