From c43fccd0c766eee01dc4807fdce6e220e5eb68a3 Mon Sep 17 00:00:00 2001 From: VSSCO <161714242+kessud2021@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:13:34 +0530 Subject: [PATCH 1/5] Update languages.yml --- lib/linguist/languages.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4c996a394a..0eb1c6d7c8 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -7072,6 +7072,15 @@ Scilab: tm_scope: source.scilab ace_mode: text language_id: 344 +SCIL: + type: programming + color: "#795e26" + extensions: + - ".scil" + - ".sil" + tm_scope: none + ace_mode: text + language_id: 67711 Self: type: programming color: "#0579aa" From ed773fde6aef68248f2fb0bdd8878a0b8b9d8168 Mon Sep 17 00:00:00 2001 From: VSSCO <161714242+kessud2021@users.noreply.github.com> Date: Fri, 9 Jan 2026 18:41:42 +0530 Subject: [PATCH 2/5] Added Strata language --- grammars.yml | 2 + lib/linguist/languages.yml | 8 ++ samples/Strata/algorithms.str | 95 +++++++++++++++++++ samples/Strata/functions.str | 66 +++++++++++++ .../strata-grammar/strata.tmLanguage.json | 46 +++++++++ 5 files changed, 217 insertions(+) create mode 100644 samples/Strata/algorithms.str create mode 100644 samples/Strata/functions.str create mode 100644 vendor/grammars/strata-grammar/strata.tmLanguage.json diff --git a/grammars.yml b/grammars.yml index f886453db0..343635457f 100644 --- a/grammars.yml +++ b/grammars.yml @@ -120,6 +120,8 @@ vendor/grammars/Slash.tmbundle: vendor/grammars/Stata.tmbundle: - source.mata - source.stata +vendor/grammars/strata-grammar: +- source.strata vendor/grammars/Stylus: - source.stylus vendor/grammars/Sublime-Coq: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index cdde4f3c34..5ac30860de 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -7490,6 +7490,14 @@ Stata: tm_scope: source.stata ace_mode: text language_id: 358 +Strata: + type: programming + color: "#4B0082" + extensions: + - ".str" + tm_scope: source.strata + ace_mode: text + language_id: 744998756 StringTemplate: type: markup color: "#3fb34f" diff --git a/samples/Strata/algorithms.str b/samples/Strata/algorithms.str new file mode 100644 index 0000000000..5c22656de6 --- /dev/null +++ b/samples/Strata/algorithms.str @@ -0,0 +1,95 @@ +// Examples: Common Algorithms +// Demonstrates: practical algorithm implementations + +import io from str +import math from str + +io.print("=== Fibonacci Sequence ===") +var a: int = 0 +var b: int = 1 + +for (var i: int = 0; i < 10; var i: int = i + 1) { + io.print(a) + let temp: int = a + b + var a: int = b + var b: int = temp +} + +io.print("=== Prime Number Check ===") + +func isPrime(n: int) => bool { + if (n <= 1) { + return false + } + + if (n == 2) { + return true + } + + if (n % 2 == 0) { + return false + } + + var i: int = 3 + while (i * i <= n) { + if (n % i == 0) { + return false + } + var i: int = i + 2 + } + + return true +} + +io.print("Primes up to 30:") +for (var num: int = 2; num <= 30; var num: int = num + 1) { + if (isPrime(num)) { + io.print(num) + } +} + +io.print("=== Sum of Digits ===") + +func sumDigits(n: int) => int { + var sum: int = 0 + var num: int = n + + while (num > 0) { + var digit: int = num % 10 + var sum: int = sum + digit + var num: int = num / 10 + } + + return sum +} + +io.print(sumDigits(12345)) +io.print(sumDigits(999)) + +io.print("=== GCD (Greatest Common Divisor) ===") + +func gcd(a: int, b: int) => int { + while (b != 0) { + let temp: int = b + var b: int = a % b + var a: int = temp + } + return a +} + +io.print(gcd(48, 18)) +io.print(gcd(100, 75)) + +io.print("=== Linear Search ===") + +func contains(target: int) => bool { + for (var i: int = 1; i <= 10; var i: int = i + 1) { + if (i == target) { + return true + } + } + return false +} + +io.print(contains(5)) +io.print(contains(15)) diff --git a/samples/Strata/functions.str b/samples/Strata/functions.str new file mode 100644 index 0000000000..9d6ec6487c --- /dev/null +++ b/samples/Strata/functions.str @@ -0,0 +1,66 @@ +// Examples: Function Declarations +// Demonstrates: func with type annotations and return types + +import io from str + +// Simple function - no parameters +func greet() => string { + return "Hello, Strata!" +} + +io.print("=== Greeting ===") +io.print(greet()) + +// Function with parameters +func add(a: int, b: int) => int { + return a + b +} + +io.print("=== Addition ===") +let result: int = add(10, 20) +io.print(result) + +// Function with multiple parameters +func multiply(x: int, y: int) => int { + return x * y +} + +io.print("=== Multiplication ===") +io.print(multiply(6, 7)) + +// Function with boolean return +func isEven(n: int) => bool { + return n % 2 == 0 +} + +io.print("=== Is Even Check ===") +io.print(isEven(4)) +io.print(isEven(7)) + +// Function with float +func average(a: float, b: float) => float { + return (a + b) / 2 +} + +io.print("=== Average ===") +io.print(average(10.5, 20.5)) + +// Function that uses loops +func factorial(n: int) => int { + var result: int = 1 + for (var i: int = 1; i <= n; var i: int = i + 1) { + var result: int = result * i + } + return result +} + +io.print("=== Factorial ===") +io.print(factorial(5)) + +// Function that doesn't return a value +func printNumber(n: int) => any { + io.print(n) +} + +io.print("=== Print via Function ===") +printNumber(42) diff --git a/vendor/grammars/strata-grammar/strata.tmLanguage.json b/vendor/grammars/strata-grammar/strata.tmLanguage.json new file mode 100644 index 0000000000..6c050b6817 --- /dev/null +++ b/vendor/grammars/strata-grammar/strata.tmLanguage.json @@ -0,0 +1,46 @@ +{ + "scopeName": "source.strata", + "name": "Strata", + "patterns": [ + { "include": "#keywords" }, + { "include": "#modules" }, + { "include": "#functions" }, + { "include": "#strings" }, + { "include": "#numbers" }, + { "include": "#comments" } + ], + "repository": { + "keywords": { + "patterns": [ + { "name": "keyword.control.strata", "match": "\\b(func|create|type|set|var|import|from)\\b" } + ] + }, + "modules": { + "patterns": [ + { "name": "support.other.module.strata", "match": "\\b(str\\.io|str\\.math|str\\.util|str\\.time|str\\.lang|str\\.net|str\\.sql|str\\.xml|str\\.rmi|str\\.security|str\\.text)\\b" } + ] + }, + "functions": { + "patterns": [ + { "name": "support.function.strata", "match": "\\b(io\\.print|math\\.sqrt|math\\.pow|math\\.random|util\\.randomInt|time\\.now)\\b" } + ] + }, + "strings": { + "patterns": [ + { "name": "string.quoted.single.strata", "match": "'[^']*'" }, + { "name": "string.quoted.double.strata", "match": "\"[^\"]*\"" } + ] + }, + "numbers": { + "patterns": [ + { "name": "constant.numeric.strata", "match": "\\b\\d+\\b" } + ] + }, + "comments": { + "patterns": [ + { "name": "comment.line.double-slash.strata", "match": "//.*$" }, + { "name": "comment.block.strata", "begin": "/\\*", "end": "\\*/" } + ] + } + } +} From 28d08439d952c2e0fde559f0d81431cc76e7d88b Mon Sep 17 00:00:00 2001 From: VSSCO <161714242+kessud2021@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:41:54 +0530 Subject: [PATCH 3/5] Add support for Strata language in heuristics Add Strata language support with specific rules. --- lib/linguist/heuristics.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/linguist/heuristics.yml b/lib/linguist/heuristics.yml index 9ed31e15d2..2af6941551 100644 --- a/lib/linguist/heuristics.yml +++ b/lib/linguist/heuristics.yml @@ -125,6 +125,15 @@ disambiguations: named_pattern: vba - language: Visual Basic 6.0 named_pattern: vb-module +- extensions: [".str"] + rules: + - language: Strata + pattern: "(?x) + \\b(func)\\b | + \\bimport\\s+\\w+\\s+from\\s+| + std::\\w+ | + package::\\w+ | + =>" - extensions: ['.bb'] rules: - language: BlitzBasic From fb19857225cc994a8528675b342264531c01260d Mon Sep 17 00:00:00 2001 From: VSSCO <161714242+kessud2021@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:31:47 +0530 Subject: [PATCH 4/5] Update lib/linguist/heuristics.yml Co-authored-by: John Gardner --- lib/linguist/heuristics.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/linguist/heuristics.yml b/lib/linguist/heuristics.yml index ac341d8d4d..b409e7dfe9 100644 --- a/lib/linguist/heuristics.yml +++ b/lib/linguist/heuristics.yml @@ -128,12 +128,12 @@ disambiguations: - extensions: [".str"] rules: - language: Strata - pattern: "(?x) - \\b(func)\\b | - \\bimport\\s+\\w+\\s+from\\s+| - std::\\w+ | - package::\\w+ | - =>" + pattern: >- + (?x) + \\b (func) \\b | + \\b import \\s+ \\w+ \\s+ from \\s+ | + (std|package):: \\w+ | + => - extensions: ['.bb'] rules: - language: BlitzBasic From 3b644e953e7eb18e37ce325284c7e65e5215e31c Mon Sep 17 00:00:00 2001 From: VSSCO <161714242+kessud2021@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:38:44 +0530 Subject: [PATCH 5/5] Delete SCIL language configuration Removed SCIL language entry from languages.yml --- lib/linguist/languages.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index eea92d8be1..e29eca650a 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -7125,15 +7125,6 @@ Scilab: tm_scope: source.scilab ace_mode: text language_id: 344 -SCIL: - type: programming - color: "#795e26" - extensions: - - ".scil" - - ".sil" - tm_scope: none - ace_mode: text - language_id: 67711 Self: type: programming color: "#0579aa"