Skip to content

Commit 493e917

Browse files
authored
#33 - Новый способ вывода +semver:feature (#125)
* #33 - лексика * #33 - грамматика * #33 - статический анализ * #33 - кодогенерация * #33 - удаление метода 'print' * #33 - правка скриптов в тестах * #33 - документация
1 parent ace888d commit 493e917

File tree

38 files changed

+140
-128
lines changed

38 files changed

+140
-128
lines changed

Readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,12 @@ let l = array[2]
168168
```
169169
let s = v2d as string
170170
```
171-
#### Стандартная библиотека
172-
- Функция `print` c сигнатурой `(string) => void`; осуществляет печать строки на экран
171+
#### Печать на экран
172+
```
173+
let obj = {}
174+
>>>obj
175+
>>>"Hello, World!"
176+
```
173177

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

samples/abs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ function abs(x: number): number {
55
}
66

77
let x = -10
8-
let a = abs(x)
9-
print(a as string)
8+
>>> abs(x)

samples/arraddremove.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
let arr = [3,3,2,1,] ++ [4,5,]
22
arr::0
3-
print(arr as string)
3+
>>>arr

samples/arreditread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ let arr = [1,2,1,]
22
let item = arr[0]
33
item = item + 2
44
arr[0] = item
5-
print(arr as string)
5+
>>>arr

samples/ceil.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ function ceil(x: number): number {
22
return x + (1 - x % 1)
33
}
44

5-
let c = ceil(3.3)
6-
print(c as string)
5+
>>> ceil(3.3)

samples/cycled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ let obj: CycledType = {
55
x: null;
66
}
77
obj.x = obj
8-
print(obj as string)
8+
>>>obj

samples/defaultarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ type numbers = number[]
22

33
let a: numbers
44

5-
print(a as string)
5+
>>>a

samples/equals.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ let obj2: withEquals = {
1414
prop: 2;
1515
}
1616

17-
let res = obj1.equals(obj2)
18-
print(res as string)
17+
>>> obj1.equals(obj2)

samples/exprtest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
let a = 1 + 3 * 2 - 5 / 5
22
// a == 6
3-
print(a as string)
3+
>>>a

samples/fastpow.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@ function fastPow(base: number, power: number): number {
1717
return multiplier * multiplier * base
1818
}
1919

20-
let p = fastPow(13, 3)
21-
22-
print(p as string)
20+
>>> fastPow(13, 3)

0 commit comments

Comments
 (0)