Skip to content

Commit 79b53a7

Browse files
authored
Merge pull request #103 from fink-lang/remove-try-throw
remove try, throw
2 parents 303041c + c1fb4b6 commit 79b53a7

File tree

9 files changed

+610
-587
lines changed

9 files changed

+610
-587
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: setup nodejs
1313
uses: actions/setup-node@v1
1414
with:
15-
node-version: 16.x
15+
node-version: 16.5
1616

1717
- name: install dependencies
1818
env:

package-lock.json

Lines changed: 584 additions & 491 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ast/analyze.test.fnk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ source = '
8282
<Spam ni shrub=nu spam={ham + 1}>
8383
</Spam>
8484

85-
try:
86-
foo
87-
8885
[ni, ..., nu] = [1234, "spam"]
8986
na = [...ni, false, true]
9087
fn foo: {foo}

src/ast/analyze.test.fnk.snap

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ Array [
1414
"ident:ni@12:4-12:6",
1515
"ident:Spam@18:0-18:4",
1616
"ident:children@18:11-18:19",
17-
"ident:ni@27:1-27:3",
18-
"ident:nu@27:10-27:12",
19-
"ident:na@28:0-28:2",
20-
"ident:foo@29:3-29:6",
21-
"ident:ham@31:7-31:10",
17+
"ident:ni@24:1-24:3",
18+
"ident:nu@24:10-24:12",
19+
"ident:na@25:0-25:2",
20+
"ident:foo@26:3-26:6",
21+
"ident:ham@28:7-28:10",
2222
]
2323
`;
2424

2525
exports[`analyze gets duplicate bindings 1`] = `
2626
Array [
27-
"ident:ni@27:1-27:3 module@1:0-33:0",
28-
"ident:nu@27:10-27:12 module@1:0-33:0",
27+
"ident:ni@24:1-24:3 module@1:0-30:0",
28+
"ident:nu@24:10-24:12 module@1:0-30:0",
2929
]
3030
`;
3131

@@ -35,7 +35,6 @@ Array [
3535
"ident:foo@7:18-7:21 -> ident:foo@1:0-1:3",
3636
"ident:foo@10:10-10:13 -> ident:foo@1:0-1:3",
3737
"ident:foo@12:9-12:12 -> ident:foo@1:0-1:3",
38-
"ident:foo@25:2-25:5 -> ident:foo@1:0-1:3",
3938
"ident:bar@8:39-8:42 -> ident:bar@3:0-3:3",
4039
"ident:bar@10:6-10:9 -> ident:bar@3:0-3:3",
4140
"ident:spam@4:7-4:11 -> ident:spam@3:9-3:13",
@@ -44,7 +43,7 @@ Array [
4443
"ident:undef@5:7-5:12 -> unbound",
4544
"ident:div@16:1-16:4 -> unbound",
4645
"ident:ham@21:24-21:27 -> unbound",
47-
"ident:map@31:0-31:3 -> unbound",
46+
"ident:map@28:0-28:3 -> unbound",
4847
"ident:ni@8:2-8:4 -> ident:ni@7:1-7:3",
4948
"ident:ni@8:45-8:47 -> ident:ni@7:1-7:3",
5049
"ident:ni@21:6-21:8 -> ident:ni@7:1-7:3",
@@ -55,30 +54,30 @@ Array [
5554
"ident:ni@13:8-13:10 -> ident:ni@12:4-12:6",
5655
"ident:Spam@21:1-21:5 -> ident:Spam@18:0-18:4",
5756
"ident:children@19:5-19:13 -> ident:children@18:11-18:19",
58-
"ident:ni@28:9-28:11 -> ident:ni@27:1-27:3",
59-
"ident:foo@29:9-29:12 -> ident:foo@29:3-29:6",
60-
"ident:ham@32:2-32:5 -> ident:ham@31:7-31:10",
57+
"ident:ni@25:9-25:11 -> ident:ni@24:1-24:3",
58+
"ident:foo@26:9-26:12 -> ident:foo@26:3-26:6",
59+
"ident:ham@29:2-29:5 -> ident:ham@28:7-28:10",
6160
]
6261
`;
6362

6463
exports[`analyze gets scopes 1`] = `
6564
Array [
66-
"ident:foo@1:0-1:3 module@1:0-33:0",
67-
"ident:bar@3:0-3:3 module@1:0-33:0",
65+
"ident:foo@1:0-1:3 module@1:0-30:0",
66+
"ident:bar@3:0-3:3 module@1:0-30:0",
6867
"ident:spam@3:9-3:13 block:fn@3:6-5:12",
6968
"ident:ham@3:19-3:22 block:fn@3:6-5:12",
7069
"ident:ni@4:2-4:4 block:fn@3:6-5:12",
71-
"ident:ni@7:1-7:3 module@1:0-33:0",
72-
"ident:nu@7:10-7:12 module@1:0-33:0",
73-
"ident:nini@8:7-8:11 module@1:0-33:0",
74-
"ident:spam@8:25-8:29 module@1:0-33:0",
70+
"ident:ni@7:1-7:3 module@1:0-30:0",
71+
"ident:nu@7:10-7:12 module@1:0-30:0",
72+
"ident:nini@8:7-8:11 module@1:0-30:0",
73+
"ident:spam@8:25-8:29 module@1:0-30:0",
7574
"ident:ni@12:4-12:6 match:expr@11:2-13:11",
76-
"ident:Spam@18:0-18:4 module@1:0-33:0",
75+
"ident:Spam@18:0-18:4 module@1:0-30:0",
7776
"ident:children@18:11-18:19 block:fn@18:7-19:17",
78-
"ident:ni@27:1-27:3 module@1:0-33:0",
79-
"ident:nu@27:10-27:12 module@1:0-33:0",
80-
"ident:na@28:0-28:2 module@1:0-33:0",
81-
"ident:foo@29:3-29:6 block:fn@29:0-29:13",
82-
"ident:ham@31:7-31:10 block:fn@31:4-33:0",
77+
"ident:ni@24:1-24:3 module@1:0-30:0",
78+
"ident:nu@24:10-24:12 module@1:0-30:0",
79+
"ident:na@25:0-25:2 module@1:0-30:0",
80+
"ident:foo@26:3-26:6 block:fn@26:0-26:13",
81+
"ident:ham@28:7-28:10 block:fn@28:4-30:0",
8382
]
8483
`;

src/lang/init.fnk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
{add_import} = import './import/init.fnk'
1717
{add_prop_access} = import './prop-access/init.fnk'
1818
{add_ignorable_tokens} = import './whitespace/init.fnk'
19-
{add_js_ops} = import './js-compat/init.fnk'
2019
{add_partial} = import './partial/init.fnk'
2120
{add_ident} = import './identifier/init.fnk'
2221

@@ -49,8 +48,6 @@ init_language = fn ctx:
4948

5049
add_literals
5150

52-
add_js_ops
53-
5451
add_call_operators
5552

5653
add_group

src/lang/js-compat/init.fnk

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/lang/js-compat/init.test.fnk

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/lang/js-compat/init.test.fnk.snap

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/lexer/tokens.fnk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ fink_lex = rx'
2727
fn|pipe|match|else|
2828
rec|list|
2929
import|
30-
await|
31-
try|throw
30+
await
3231
)(?=\s|:))
3332
|(?<kwop>(in|or|and|not)(?=\s))
3433
|(?<value>(true|false)\b)
@@ -265,7 +264,7 @@ tokenize = fn code, start={pos: 0, line: 1, column: 0}:
265264
# testing type in keywords or just use 'ident' for keywords
266265
keywords = list:
267266
'import', 'fn', 'pipe', 'match', 'else'
268-
'list', 'rec', 'await', 'try', 'throw',
267+
'list', 'rec', 'await'
269268
'and', 'or', 'not', 'in', 'true', 'false'
270269

271270

0 commit comments

Comments
 (0)