This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
dcf6c4e
commit 7dccdd4
Showing
10 changed files
with
99 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Arrow.Core.Parsing.Definition | ||
{ | ||
[Syntax(SyntaxDefinitionType.FieldDeclaration)] | ||
public class FieldDeclarationSyntax : VariableDeclarationSyntax | ||
{ | ||
public FieldDeclarationSyntax() : base(nameof(FieldDeclarationSyntax)) | ||
{ | ||
|
||
} | ||
|
||
public override bool TryParse(SyntaxStream stream, Scanner scanner) | ||
{ | ||
for (int i = 0; i < stream.Count; i++) | ||
{ | ||
if (stream[i].Name == "CodeLineEnd") | ||
{ | ||
var result = base.TryParse(stream.Take(i), scanner); | ||
Length += 1; | ||
return result; | ||
} | ||
} | ||
|
||
return false; | ||
|
||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Arrow.Core; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace CompilerTests | ||
{ | ||
[TestClass] | ||
public class FieldTests | ||
{ | ||
private ArrowCompiler compiler; | ||
|
||
public FieldTests() | ||
{ | ||
compiler = new ArrowCompiler(); | ||
} | ||
|
||
[TestMethod] | ||
public void SimpleFieldTest() | ||
{ | ||
compiler.GetAssembly( | ||
@"class test { | ||
var global : int; | ||
}"); | ||
} | ||
} | ||
} |
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,5 +1,7 @@ | ||
class Math | ||
{ | ||
var det : int; | ||
|
||
def Add(base : int, value : int) : int | ||
{ | ||
ret base + value; | ||
|