Skip to content

Commit 79b9894

Browse files
author
Robert Durst
authored
Merge pull request #107 from sailfish-lang/0.2.0.temp
0.2.0
2 parents 4a37e77 + 46a5f11 commit 79b9894

File tree

126 files changed

+3073
-10457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+3073
-10457
lines changed

CMakeLists.txt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
cmake_minimum_required(VERSION 2.6)
22

33
set(CMAKE_CXX_STANDARD 17)
4+
# set (CMAKE_CXX_FLAGS "-g")
45

56
# Add sailfishc libs. TODO: write this more eloquently
67
ADD_LIBRARY(SailfishcLibs
78
./src/lexar/Lexar.cpp
8-
./src/lexar/Lexar2.cpp
9-
./src/lexar/Token2.cpp
10-
./src/parser/Parser.cpp
11-
./src/parser/Parser2.cpp
12-
./src/parser/Lexeme.cpp
13-
./src/visitor/Visitor.cpp
14-
./src/semantics/SymbolTable.cpp
15-
./src/semantics/TypeChecker.cpp
16-
./src/errorhandler/SemanticErrorHandler.cpp
17-
./src/errorhandler/SymbolTableErrorHandler.cpp
9+
./src/lexar/Token.cpp
10+
./src/sailfish/sailfishc.cpp
1811
./src/errorhandler/ParserErrorHandler.cpp
19-
./src/errorhandler/Parser2ErrorHandler.cpp
20-
./src/common/ReservedWords.cpp
12+
./src/errorhandler/SemanticAnalyzerErrorHandler.cpp
2113
./src/main/CommandLine.cpp
22-
./src/transpiler/Transpiler.cpp
14+
./src/semantics/SymbolTable.cpp
15+
./src/stdlib_c/stdlib_c.cpp
16+
./src/stdlib_c/Lists.cpp
2317
)
2418

2519
add_executable(sailfishc ./src/main/main.cpp ${DirSOURCES})

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ For now, you can either build from source:
1616

1717
Or use the install script [here](https://github.com/sailfish-lang/sailfish-lang-install-script.git).
1818

19-
## Development
20-
21-
To run tests, you'll need [GoogleTest](https://github.com/google/googletest) and [CMake](https://cmake.org). There is a nice tutorial on how to get GoogleTest up and running on Ubuntu [here](https://www.eriksmistad.no/getting-started-with-google-test-on-ubuntu/). Also check [this](https://github.com/AppImage/AppImageKit/issues/571#issuecomment-349471627) out if gtest isn't working In order to run the test suite, follow these steps:
22-
```
23-
cd test
24-
cmake CMakeLists.txt
25-
make
26-
./sailfishc_tests
27-
```
28-
2919
***
3020

3121
## Sailfish Wiki

examples/counter.fish

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/fizzbuzz.fish

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/intListHandler.fish

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Uat {
2+
[int] list
3+
int size
4+
}
5+
6+
Ufn{
7+
(fun printFoo_(int i)(void){
8+
Tree(
9+
(| i != own.size | {
10+
printInt(getAtIndexInt(own.list, i))
11+
++i
12+
own...printFoo_(i)
13+
})
14+
)
15+
})
16+
17+
(fun printFoo(void)(void){
18+
printStr("List Contents:")
19+
own...printFoo_(0)
20+
})
21+
22+
# rather inefficient because we malloc every time
23+
(fun push(int i)(void){
24+
dec [int] is = [i]
25+
own.list = appendListInt(own.list, is, own.size, 1)
26+
++own.size
27+
})
28+
29+
(fun removeByIndex(int i)(void){
30+
Tree (
31+
( | own.size == 0 | { printStr("Sorry, list is empty!") })
32+
( | true | {
33+
own.list = deleteAtIndexInt(own.list, own.size, i)
34+
--own.size
35+
})
36+
)
37+
})
38+
39+
(fun setAtIndex(int i, int v)(void){
40+
Tree (
41+
( | (i > own.size) or (i < 0) | { printStr("Invalid index") } )
42+
( | true | { own.list = setAtIndexInt(own.list, i, v) })
43+
)
44+
})
45+
}

examples/sailfishv2.fish

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/stack.fish

Lines changed: 0 additions & 156 deletions
This file was deleted.

examples/test.fish

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
import Foo : "foo.fish"
1+
import intListHandler : "../examples/intListHandler.fish"
22

3-
Uat {
4-
int i
5-
flt f
6-
}
7-
8-
Ufn {
9-
(fun main(int i)(int){
10-
Tree (
11-
(|1 + 2 == 11 - 12 | {
12-
dec int i = 10
13-
a = 12 + (i - 10)
14-
return a
15-
})
16-
)
17-
})
3+
start {
4+
dec intListHandler i = new intListHandler { size: 100, list: []}
5+
dec [int] is = []
186
}

examples/test2.fish

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/test_uda.fish

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)