Skip to content

Commit 54e46c1

Browse files
committed
Unsafe evolution: safe/unsafe externs
1 parent a3319f6 commit 54e46c1

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/build-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v6
16+
uses: actions/checkout@v7
1717
with:
1818
fetch-depth: 0
1919

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@codemirror/buildhelper": "^1.0.0",
4040
"@codemirror/lang-xml": "^6.0.0",
4141
"@codemirror/theme-one-dark": "^6.0.0",
42-
"@types/node": "^25.6.0",
42+
"@types/node": "^26.0.0",
4343
"@vitejs/plugin-legacy": "^8.0.0",
4444
"codemirror": "^6.0.0",
4545
"lz-string": "^1.0.0",

src/keywords.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const keywords = [
1111
"namespace", "new", "not", "notnull", "on", "operator",
1212
"or", "orderby", "out", "override", "params", "partial",
1313
"private", "protected", "public", "readonly", "record", "ref",
14-
"remove", "required", "return", "scoped", "sealed", "select",
14+
"remove", "required", "return", "safe", "scoped", "sealed", "select",
1515
"set", "sizeof", "stackalloc", "static", "struct", "switch",
1616
"this", "throw", "try", "typeof", "unchecked", "union",
1717
"unmanaged", "unsafe", "using", "value", "var", "virtual",

src/syntax.grammar

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ constDeclarator { ConstName !assign '=' expr }
11261126
LocalFuncDecl[group=Declaration] { localFuncHeader localFuncBody }
11271127

11281128
localFuncHeader {
1129-
(kw<'async'> | kw<'unsafe'> | kw<'static'> | kw<'extern'>)*
1129+
(kw<'async'> | kw<'unsafe'> | kw<'safe'> | kw<'static'> | kw<'extern'>)*
11301130
(ref ~ref)? type MethodName
11311131
(!typeParams typeParamList)? !params formalParams
11321132
typeParamConstraintsClause*
@@ -1153,13 +1153,15 @@ topLevelLocalFuncModifiers {
11531153
topLevelLocalFuncModifierHead {
11541154
kw<'async'> !topLevelLocalFunc
11551155
| kw<'unsafe'> !topLevelLocalFunc
1156+
| kw<'safe'> !topLevelLocalFunc
11561157
| kw<'static'> !topLevelLocalFunc
11571158
| kw<'extern'> !topLevelLocalFunc
11581159
}
11591160

11601161
topLevelLocalFuncModifier {
11611162
kw<'async'>
11621163
| kw<'unsafe'>
1164+
| kw<'safe'>
11631165
| kw<'static'>
11641166
| kw<'extern'>
11651167
}
@@ -1424,6 +1426,7 @@ modifier {
14241426
| kw<'partial'>
14251427
| kw<'ref'>
14261428
| kw<'required'>
1429+
| kw<'safe'>
14271430
| kw<'file'>
14281431
| kw<'closed'>
14291432
}

0 commit comments

Comments
 (0)