-
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.
* added some basic tests for the symbol resolver pass - related to ref sealangdotorg/sea#22
- Loading branch information
1 parent
050b375
commit 943267c
Showing
10 changed files
with
363 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule foo = | ||
{ | ||
assert( true ) | ||
|
||
assert( true, "this is a true assertion" ) | ||
|
||
program( self ) := undef | ||
} |
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,37 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
function bar : -> Integer | ||
|
||
derived qux -> Integer = bar | ||
|
||
rule foo = | ||
{ | ||
bar := qux + qux | ||
|
||
program( self ) := undef | ||
} |
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,35 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
enum ABC = { A, B, C } | ||
|
||
rule foo = | ||
{ | ||
print( A ) | ||
|
||
program( self ) := undef | ||
} |
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,37 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule foo = | ||
{ | ||
bar //@ERROR( ? ) | ||
qux //@ERROR( ? ) | ||
|
||
call bar //@ERROR( ? ) | ||
call qux //@ERROR( ? ) | ||
|
||
program( self ) := undef | ||
} |
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,35 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
function bar : -> Integer | ||
|
||
rule foo = | ||
{ | ||
bar := bar + bar | ||
|
||
program( self ) := undef | ||
} |
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,36 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule foo = | ||
{ | ||
let bar = 1 in | ||
{ | ||
print( bar ) | ||
} | ||
|
||
program( self ) := undef | ||
} |
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,41 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule foo = | ||
{ | ||
let bar = 1 in | ||
{ | ||
print( bar ) | ||
} | ||
|
||
let bar = 2 in | ||
{ | ||
print( bar ) | ||
} | ||
|
||
program( self ) := undef | ||
} |
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,38 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule bar = | ||
{ | ||
skip | ||
} | ||
|
||
rule foo = | ||
{ | ||
call bar | ||
|
||
call (*@bar)() | ||
} |
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,38 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule bar( qux : Integer ) = | ||
{ | ||
print( qux ) | ||
} | ||
|
||
rule foo = | ||
{ | ||
call bar | ||
|
||
call (*@bar)() | ||
} |
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,31 @@ | ||
// | ||
// Copyright (c) 2014-2017 CASM Organization | ||
// All rights reserved. | ||
// | ||
// Developed by: Philipp Paulweber | ||
// Emmanuel Pescosta | ||
// https://github.com/casm-lang/libcasm-tc | ||
// | ||
// This file is part of libcasm-tc. | ||
// | ||
// libcasm-tc is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// libcasm-tc is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with libcasm-tc. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
|
||
CASM init foo | ||
|
||
rule foo = | ||
{ | ||
program( self ) := undef | ||
} |