-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from antoniusnaumann/refactor/tree-sitter-parser
Refactor/tree sitter parser
- Loading branch information
Showing
100 changed files
with
3,057 additions
and
2,613 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/.idea/ | ||
.DS_Store | ||
__*/ | ||
temp/ |
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,3 @@ | ||
[submodule "tree-sitter-galvan"] | ||
path = tree-sitter-galvan | ||
url = https://github.com/antoniusnaumann/tree-sitter-galvan |
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,7 +1,3 @@ | ||
/*# AST | ||
empty() | ||
*/ | ||
|
||
/*# TRANSPILE | ||
"" | ||
*/ | ||
//@TRANSPILE | ||
//"" | ||
//@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
/*# AST | ||
single(function(inherited(), "empty", params(vec![]), None, empty_body())) | ||
*/ | ||
//@TRANSPILE | ||
// "pub(crate) fn empty() { }" | ||
//@end | ||
|
||
/*# TRANSPILE | ||
"pub(crate) fn empty() { }" | ||
*/ | ||
|
||
fn empty() {} | ||
fn empty() {} |
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,28 +1,12 @@ | ||
/*# AST | ||
multi(vec![ | ||
empty_type(inherited(), "Dog").into(), | ||
function( | ||
inherited(), | ||
"woof", | ||
params( | ||
vec![ | ||
(None, "self", plain("Dog")), | ||
]), | ||
None, | ||
empty_body() | ||
).into() | ||
]) | ||
*/ | ||
|
||
/*# TRANSPILE | ||
" | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub(crate) struct Dog; | ||
impl Dog { | ||
pub(crate) fn woof(&self) { } | ||
} | ||
" | ||
*/ | ||
//@TRANSPILE | ||
//" | ||
//#[derive(Clone, Debug, PartialEq)] | ||
//pub(crate) struct Dog; | ||
//impl Dog { | ||
//pub(crate) fn woof(&self) { } | ||
//} | ||
//" | ||
//@end | ||
type Dog | ||
|
||
fn woof(self: Dog) { } | ||
fn woof(self: Dog) { } |
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,26 +1,10 @@ | ||
/*# AST | ||
multi(vec![ | ||
empty_type(inherited(), "Dog").into(), | ||
function( | ||
inherited(), | ||
"bark", | ||
params( | ||
vec![ | ||
(Some(Mut.into()), "dog", plain("Dog")), | ||
]), | ||
None, | ||
empty_body() | ||
).into() | ||
]) | ||
*/ | ||
|
||
/*# TRANSPILE | ||
" | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub(crate) struct Dog; | ||
pub(crate) fn bark(dog: &mut Dog) { } | ||
" | ||
*/ | ||
//@TRANSPILE | ||
//" | ||
//#[derive(Clone, Debug, PartialEq)] | ||
//pub(crate) struct Dog; | ||
//pub(crate) fn bark(dog: &mut Dog) { } | ||
//" | ||
//@end | ||
type Dog | ||
|
||
fn bark(mut dog: Dog) { } | ||
fn bark(mut dog: Dog) { } |
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,26 +1,10 @@ | ||
/*# AST | ||
multi(vec![ | ||
empty_type(inherited(), "Dog").into(), | ||
function( | ||
inherited(), | ||
"bark", | ||
params( | ||
vec![ | ||
(Some(Ref.into()), "dog", plain("Dog")), | ||
]), | ||
None, | ||
empty_body() | ||
).into() | ||
]) | ||
*/ | ||
|
||
/*# TRANSPILE | ||
" | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub(crate) struct Dog; | ||
pub(crate) fn bark(dog: std::sync::Arc<std::sync::Mutex<Dog>>) { } | ||
" | ||
*/ | ||
//@TRANSPILE | ||
//" | ||
//#[derive(Clone, Debug, PartialEq)] | ||
//pub(crate) struct Dog; | ||
//pub(crate) fn bark(dog: std::sync::Arc<std::sync::Mutex<Dog>>) { } | ||
//" | ||
//@end | ||
type Dog | ||
|
||
fn bark(ref dog: Dog) { } | ||
fn bark(ref dog: Dog) { } |
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,23 +1,7 @@ | ||
/*# AST | ||
single( | ||
function( | ||
public(), | ||
"add", | ||
params( | ||
vec![ | ||
(None, "a", plain("Int")), | ||
(None, "b", plain("Int")) | ||
]), | ||
Some(plain("Int")), | ||
empty_body() | ||
) | ||
) | ||
*/ | ||
|
||
/*# TRANSPILE | ||
"pub fn add(a: i64, b: i64) -> i64 { }" | ||
*/ | ||
//@TRANSPILE | ||
//"pub fn add(a: i64, b: i64) -> i64 { }" | ||
//@end | ||
|
||
pub fn add(a: Int, b: Int) -> Int { | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
/*# AST | ||
single(alias_type(inherited(), "IntArray", array(plain("Int")))) | ||
*/ | ||
//@TRANSPILE | ||
//"pub(crate) type IntArray = ::std::vec::Vec<i64>;" | ||
//@end | ||
|
||
/*# TRANSPILE | ||
"pub(crate) type IntArray = ::std::vec::Vec<i64>;" | ||
*/ | ||
|
||
type IntArray = [Int] | ||
type IntArray = [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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
/*# AST | ||
single(struct_type(inherited(), "EmptyStruct", vec![])) | ||
*/ | ||
//@TRANSPILE | ||
//"#[derive(Clone, Debug, PartialEq)] pub(crate) struct EmptyStruct { }" | ||
//@end | ||
|
||
/*# TRANSPILE | ||
"#[derive(Clone, Debug, PartialEq)] pub(crate) struct EmptyStruct { }" | ||
*/ | ||
|
||
type EmptyStruct {} | ||
type EmptyStruct {} |
Oops, something went wrong.