Dino compiler: language, formatter, language server, docs, editor support
Compiler in Rust (lexer, parser, checker, C codegen), maps, chars, dino fmt, dino lsp (diagnostics, formatting, outline, definition, hover, completion, signature help), docs, examples, VS Code/Vim files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e2779f447
commit
eaf9567a36
117 files changed
+19970
No files matched your search
@@ -0,0 +1,13 @@
|
||||
// A module: everything marked `pub` can be used by the file that imports it.
|
||||
import math
|
||||
|
||||
pub const UNIT = 1.0
|
||||
|
||||
pub struct Point {
|
||||
pub x, y: float
|
||||
pub func dist(other: Point): float {
|
||||
return math.sqrt((x - other.x) * (x - other.x) + (y - other.y) * (y - other.y))
|
||||
}
|
||||
}
|
||||
|
||||
pub func origin(): Point { return Point{0.0, 0.0} }
|
||||
@@ -0,0 +1,6 @@
|
||||
import geometry
|
||||
|
||||
func main() {
|
||||
var p = geometry.Point{3.0, 4.0}
|
||||
print(p.dist(geometry.origin()), geometry.UNIT)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
1 100
|
||||
2 1
|
||||
3
|
||||
10 22 11 20
|
||||
0 1 1
|
||||
7
|
||||
Reference in new issue
Block a user