Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.1.0 #130

Merged
merged 22 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1479e72
#103 - вернул префикс (#104)
StefanioHabrArticles Aug 14, 2024
a1c2e1d
#105 - fix GitVersion.yml +semver:skip (#106)
Stepami Aug 14, 2024
6a52cc6
#97 - внедрение логгера (#108)
Stepami Aug 17, 2024
df2d0b7
Улучшения работы с текстовыми координатами (#110)
Stepami Aug 20, 2024
bfc6c2e
Переход на NSubstitute и удаление Moq +semver:skip (#75)
Stepami Sep 14, 2024
a9d289a
Добавлен Directory.Build.props +semver:skip (#113)
Keyros Sep 16, 2024
c1bd557
#79 - enum'ы вместо строк как ключи для DI +semver:skip (#114)
Stepami Sep 20, 2024
dd2a121
#78 - переписал SG на полностью автоматическую генерацию паттерна рег…
Stepami Sep 20, 2024
b579085
Update Readme.md +semver:none
Stepami Oct 6, 2024
fe39e34
Update Readme.md +semver:none
Stepami Oct 6, 2024
c36f9bf
Update Readme.md +semver:none
Stepami Oct 7, 2024
d29fb72
Внедрение ITestOutputHelper через xUnit DI +semver:skip (#116)
Stepami Oct 9, 2024
b4dc168
Fix/bug 49 (#117)
Stepami Oct 13, 2024
f40012b
#118 - private assets all для SG ref (#119) +semver:skip
Stepami Nov 2, 2024
3cbc9eb
#55 - запрет на присваивание void (#120)
Stepami Nov 3, 2024
7aad345
Feature/Перейти на OrderedDictionary в FunctionWithUndefinedReturnSto…
hw2cb Feb 1, 2025
890aa92
#122 - Прописал свой скоп литералу объекта (#123)
Stepami Feb 2, 2025
ace888d
#56 - запретит присваивания null в ситуациях неопределённого типа (#124)
Stepami Feb 2, 2025
493e917
#33 - Новый способ вывода +semver:feature (#125)
Stepami Feb 2, 2025
6e4fb12
fix release workflow +semver:none
Stepami Feb 2, 2025
bb61f9e
убрал макось на интеле +semver:skip
Stepami Feb 2, 2025
e21ffe3
explicit net7.0 release.yml +semver:skip
Stepami Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
Expand Down Expand Up @@ -48,9 +52,7 @@ jobs:
config:
- os: ubuntu-latest
rid: linux-x64
- os: macos-12
rid: osx-x64
- os: macos-14
- os: macos-latest
rid: osx-arm64
- os: windows-latest
rid: win-x64
Expand All @@ -61,7 +63,9 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: |
7.0.x
9.0.x
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
with:
Expand All @@ -86,6 +90,10 @@ jobs:
runs-on: ubuntu-latest
needs: upload-release-assets
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
with:
Expand Down
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>

</Project>
17 changes: 17 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<ItemGroup>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Scrutor" Version="4.2.2" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
<PackageVersion Include="System.IO.Abstractions" Version="21.0.29" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="Visitor.NET" Version="4.1.2" />
<PackageVersion Include="Visitor.NET.AutoVisitableGen" Version="1.3.0" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions ExtendedJavaScriptSubset.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
SECURITY.md = SECURITY.md
hydrascript-logo.jpg = hydrascript-logo.jpg
GitVersion.yml = GitVersion.yml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolder", "{54CBE5A7-3C3E-44ED-B877-7B08A818083B}"
Expand Down Expand Up @@ -63,11 +65,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{04AB
samples\typeresolving.js = samples\typeresolving.js
samples\vec2d.js = samples\vec2d.js
samples\cycled.js = samples\cycled.js
samples\scope.js = samples\scope.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{FB8F6EE1-1942-46D6-954E-9A1647BBDF10}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{3F131901-A9EC-451A-B7E9-726887CFE5FB}"
ProjectSection(SolutionItems) = preProject
tests\Directory.Build.props = tests\Directory.Build.props
tests\Directory.Packages.props = tests\Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{A280C99E-0112-4F3C-A5E9-B793F2D9898E}"
EndProject
Expand Down
2 changes: 2 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
mode: Mainline
branches:
release:
tag: ''
regex: ^release$
increment: None
ignore:
sha: []
Expand Down
28 changes: 9 additions & 19 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@

![logo](hydrascript-logo.jpg)

![Code Coverage](https://img.shields.io/badge/Code%20Coverage-47%25-critical?style=flat)

| Package | Line Rate | Health |
|----------------------------------------|-----------------------|--------|
| HydraScript.Domain.BackEnd | 81% | ➖ |
| HydraScript.Infrastructure | 70% | ❌ |
| HydraScript.Domain.FrontEnd | 57% | ❌ |
| HydraScript.Domain.IR | 74% | ❌ |
| HydraScript.Application.CodeGeneration | 0% | ❌ |
| HydraScript.Application.StaticAnalysis | 4% | ❌ |
| **Summary** | **47%** (1325 / 2792) | ❌ |

_Minimum allowed line rate is `80%`_

## "Расширенное подмножество ЯП JavaScript"

### Вводная информация
Expand Down Expand Up @@ -182,12 +168,16 @@ let l = array[2]
```
let s = v2d as string
```
#### Стандартная библиотека
- Функция `print` c сигнатурой `(string) => void`; осуществляет печать строки на экран
#### Печать на экран
```
let obj = {}
>>>obj
>>>"Hello, World!"
```

### Требования

- .NET 8 SDK
- .NET 9 SDK

### Сборка
После клонирования репозитория идём в папку проекта `HydraScript`.
Expand All @@ -211,10 +201,10 @@ HydraScript file.js --dump

### Источники:

1. Курсы "Конструирование Компиляторов" и "Генерация Оптимального Кода" кафедры ИУ-9 МГТУ им. Н.Э. Баумана
1. Курсы "Конструирование Компиляторов" и "Генерация Оптимального Кода" кафедры ИУ-9 МГТУ им. Н.Э. Баумана [@bmstu-iu9](https://www.github.com/bmstu-iu9)
2. [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/)
3. [DragonBook](https://suif.stanford.edu/dragonbook/)
4. [Stanford CS143 Lectures](https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/)
5. [Simple Virtual Machine](https://github.com/parrt/simple-virtual-machine)
6. Ахо А., Ульман Дж. Теория синтаксического анализа, перевода и компиляции
7. Свердлов С.З. Языки программирования и методы трансляции
7. Свердлов С.З. Языки программирования и методы трансляции
3 changes: 1 addition & 2 deletions samples/abs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ function abs(x: number): number {
}

let x = -10
let a = abs(x)
print(a as string)
>>> abs(x)
2 changes: 1 addition & 1 deletion samples/arraddremove.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
let arr = [3,3,2,1,] ++ [4,5,]
arr::0
print(arr as string)
>>>arr
2 changes: 1 addition & 1 deletion samples/arreditread.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ let arr = [1,2,1,]
let item = arr[0]
item = item + 2
arr[0] = item
print(arr as string)
>>>arr
3 changes: 1 addition & 2 deletions samples/ceil.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ function ceil(x: number): number {
return x + (1 - x % 1)
}

let c = ceil(3.3)
print(c as string)
>>> ceil(3.3)
2 changes: 1 addition & 1 deletion samples/cycled.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ let obj: CycledType = {
x: null;
}
obj.x = obj
print(obj as string)
>>>obj
2 changes: 1 addition & 1 deletion samples/defaultarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ type numbers = number[]

let a: numbers

print(a as string)
>>>a
3 changes: 1 addition & 2 deletions samples/equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ let obj2: withEquals = {
prop: 2;
}

let res = obj1.equals(obj2)
print(res as string)
>>> obj1.equals(obj2)
2 changes: 1 addition & 1 deletion samples/exprtest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
let a = 1 + 3 * 2 - 5 / 5
// a == 6
print(a as string)
>>>a
4 changes: 1 addition & 3 deletions samples/fastpow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ function fastPow(base: number, power: number): number {
return multiplier * multiplier * base
}

let p = fastPow(13, 3)

print(p as string)
>>> fastPow(13, 3)
2 changes: 1 addition & 1 deletion samples/forwardref.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ let a: A = {
};
}

print(a as string)
>>>a
4 changes: 1 addition & 3 deletions samples/gcd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ function gcd(a: number, b: number): number {
return gcd(bb, aa % bb)
}

let g = gcd(1280, 720)

print(g as string)
>>> gcd(1280, 720)
3 changes: 1 addition & 2 deletions samples/lcm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ function lcm(a: number, b: number): number {
return (abs(a * b)) / (gcd(a, b))
}

let l = lcm(1280, 720)
print(l as string)
>>> lcm(1280, 720)
7 changes: 3 additions & 4 deletions samples/linkedlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function append(lst: list, item: number) {

function getOdd(lst: list): number[] {
let result: number[]
let n = lst.head
let n: node = lst.head
while (n != null) {
if (n.data % 2 != 0) {
let i = n.data
Expand All @@ -42,7 +42,6 @@ linkedList.append(3)
linkedList.append(5)
linkedList.append(7)

print(linkedList as string)
>>>linkedList

let odds = linkedList.getOdd()
print(odds as string)
>>> linkedList.getOdd()
2 changes: 1 addition & 1 deletion samples/objeditread.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ let obj2 = {
}

obj2.k = obj1.p.s.v
print(obj2 as string)
>>>obj2
6 changes: 3 additions & 3 deletions samples/posneg.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ function negative(x: number): boolean {

let x = 0
if (positive(x)) {
print("positive")
>>>"positive"
} else if (negative(x)) {
print("negative")
>>>"negative"
} else {
print("zero")
>>>"zero"
}
4 changes: 1 addition & 3 deletions samples/prime.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ function prime(x: number): boolean {
return true
}

let b = prime(13)

print(b as string)
>>> prime(13)
4 changes: 2 additions & 2 deletions samples/primefactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ let factor = 2
while (factor * factor <= n) {
while (n % factor == 0) {
n = n / factor
print(factor as string)
>>>factor
}

factor = factor + 1
}

if (n != 1) {
print(factor as string)
>>>factor
}
2 changes: 1 addition & 1 deletion samples/quicksort.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ function quickSort(values: ints) {

let numbers = [6,2,4,3,7,1,5,]
quickSort(numbers)
print(numbers as string)
>>>numbers
3 changes: 1 addition & 2 deletions samples/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ function range(n: int): ints {
return r
}

let r1to6 = range(6)
print(r1to6 as string)
>>> range(6)
4 changes: 2 additions & 2 deletions samples/recur.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ let n: number
n = 6
let fa6 = fact(6)
let fa6s = fa6 as string
print("fact(6) = " + fa6s)
>>> "fact(6) = " + fa6s

n = 9
let fi9 = fib(9)
let fi9s = fi9 as string
print("fib(9) = " + fi9s)
>>> "fib(9) = " + fi9s
10 changes: 10 additions & 0 deletions samples/scope.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type Obj = {
x: number;
}

let x: Obj
x = {
x: 1;
}

>>>x.x
Loading