-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
524 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"workbench.iconTheme": "material-icon-theme" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ The syntax in Zep is like so | |
fn add(a: i32, b: i32) -> i32 { | ||
rt a + b | ||
} | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import { Program } from "./Program"; | ||
export class RangeData { | ||
public line: number = 0; | ||
public column: number = 0; | ||
} | ||
|
||
export class Range { | ||
public line: number; | ||
public start: number; | ||
public end: number; | ||
constructor(line: number, start: number, end: number) { | ||
this.line = line; | ||
public start: RangeData; | ||
public end: RangeData; | ||
// public source: Source; | ||
constructor(start: RangeData, end: RangeData) { | ||
this.start = start; | ||
this.end = end; | ||
} | ||
static from(start: Range, end: Range): Range { | ||
return new Range(start.start, end.end); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { Scope } from "../../checker/scope/Scope.js"; | ||
import { Range } from "../Range.js"; | ||
import { Expression } from "./Expression.js"; | ||
import { Statement } from "./Statement.js"; | ||
|
||
export class BlockExpression extends Expression { | ||
public nameOf: string = "BlockExpression"; | ||
public scope: Scope = new Scope(); | ||
constructor(public statements: Statement[]) { | ||
public statements: Statement[]; | ||
public scope: Scope; | ||
constructor(statements: Statement[], scope: Scope, range: Range) { | ||
super(); | ||
this.statements = statements; | ||
this.scope = scope; | ||
this.range = range; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { Range } from "../Range.js"; | ||
import { Expression } from "./Expression.js"; | ||
|
||
export class BooleanLiteral extends Expression { | ||
public nameOf: string = "BooleanLiteral"; | ||
constructor( | ||
public value: boolean | ||
) { | ||
public value: boolean; | ||
constructor(value: boolean, range: Range) { | ||
super(); | ||
this.value = value; | ||
this.range = range; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { Range } from "../Range.js"; | ||
import { Identifier } from "./Identifier.js"; | ||
import { Statement } from "./Statement.js"; | ||
|
||
export class BranchToStatement extends Statement { | ||
public nameOf: string = "BranchStatement"; | ||
public to: Identifier; | ||
constructor(to: Identifier) { | ||
constructor(to: Identifier, range: Range) { | ||
super(); | ||
this.to = to; | ||
this.range = range; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import { Range } from "../Range.js"; | ||
import { Expression } from "./Expression.js"; | ||
import { Identifier } from "./Identifier.js"; | ||
|
||
export class CallExpression extends Expression { | ||
public nameOf: string = "CallExpression"; | ||
constructor( | ||
public calling: Identifier, | ||
public parameters: Expression[], | ||
) { | ||
public calling: Identifier; | ||
public parameters: Expression[]; | ||
constructor(calling: Identifier, parameters: Expression[], range: Range) { | ||
super(); | ||
this.calling = calling; | ||
this.parameters = parameters; | ||
this.range = range; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import { Range } from "../Range"; | ||
|
||
export class Expression { | ||
public nameOf: string = "Expression"; | ||
public range: Range = new Range(-1, -1, -1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { Range } from "../Range.js"; | ||
import { Identifier } from "./Identifier.js"; | ||
import { Statement } from "./Statement.js"; | ||
|
||
export class ImportDeclaration extends Statement { | ||
public nameOf: string = "ImportDeclaration"; | ||
public path: Identifier; | ||
constructor(path: Identifier) { | ||
constructor(path: Identifier, range: Range) { | ||
super(); | ||
this.path = path; | ||
this.range = range; | ||
} | ||
} |
Oops, something went wrong.