mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-14 08:25:02 +01:00
fmt
This commit is contained in:
parent
bf9fbcc069
commit
7ca78530a1
4 changed files with 58 additions and 36 deletions
|
|
@ -10,7 +10,7 @@ A Riverdelta program consists of many items, like functions. Every item ends wit
|
|||
semicolon.
|
||||
|
||||
```js
|
||||
item = item_function | item_type | item_import | item_extern | item_mod
|
||||
item = item_function | item_type | item_import | item_extern | item_mod;
|
||||
```
|
||||
|
||||
### Functions
|
||||
|
|
@ -25,6 +25,7 @@ item_function := "function" function_sig "=" expr ";"
|
|||
```js
|
||||
function helloWorld() = ;
|
||||
```
|
||||
|
||||
```js
|
||||
function block() = (
|
||||
1;
|
||||
|
|
@ -136,7 +137,6 @@ the module statement.
|
|||
`.nil` files cannot declare file submodules but only inline modules.
|
||||
If the current file is `a/a.mod.nil`, then `mod foo;` will look for `a/b.nil` or `a/b/b.mod.nil`.
|
||||
|
||||
|
||||
### Globals
|
||||
|
||||
Globals are mutable values.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,15 @@ import {
|
|||
import { CompilerError, ErrorEmitted, Span, unreachable } from "../error";
|
||||
import { printTy } from "../printer";
|
||||
import { InferContext } from "./infer";
|
||||
import { TypeckCtx, emitError, lowerAstTy, mkTyFn, tyError, tyErrorFrom, typeOfItem } from "./item";
|
||||
import {
|
||||
TypeckCtx,
|
||||
emitError,
|
||||
lowerAstTy,
|
||||
mkTyFn,
|
||||
tyError,
|
||||
tyErrorFrom,
|
||||
typeOfItem,
|
||||
} from "./item";
|
||||
|
||||
export function exprError(err: ErrorEmitted, span: Span): Expr<Typecked> {
|
||||
return {
|
||||
|
|
@ -71,7 +79,6 @@ type FuncCtx = {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
export function typeOfBuiltinValue(
|
||||
fcx: FuncCtx,
|
||||
name: BuiltinName,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
import { Crate, Expr, Folder, Item, ItemId, Resolved, TY_I32, TY_INT, Ty, TyFn, Typecked, foldAst, mkDefaultFolder, tyIsUnit } from "../ast";
|
||||
import {
|
||||
Crate,
|
||||
Expr,
|
||||
Folder,
|
||||
Item,
|
||||
ItemId,
|
||||
Resolved,
|
||||
TY_I32,
|
||||
TY_INT,
|
||||
Ty,
|
||||
TyFn,
|
||||
Typecked,
|
||||
foldAst,
|
||||
mkDefaultFolder,
|
||||
tyIsUnit,
|
||||
} from "../ast";
|
||||
import { GlobalContext } from "../context";
|
||||
import { CompilerError, ErrorEmitted, Span } from "../error";
|
||||
import { ComplexMap } from "../utils";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue