Skip to content

Commit

Permalink
Merge pull request #107 from sailfish-lang/0.2.0.temp
Browse files Browse the repository at this point in the history
0.2.0
  • Loading branch information
Robert Durst committed Apr 21, 2019
2 parents 4a37e77 + 46a5f11 commit 79b9894
Show file tree
Hide file tree
Showing 126 changed files with 3,073 additions and 10,457 deletions.
20 changes: 7 additions & 13 deletions CMakeLists.txt
@@ -1,25 +1,19 @@
cmake_minimum_required(VERSION 2.6)

set(CMAKE_CXX_STANDARD 17)
# set (CMAKE_CXX_FLAGS "-g")

# Add sailfishc libs. TODO: write this more eloquently
ADD_LIBRARY(SailfishcLibs
./src/lexar/Lexar.cpp
./src/lexar/Lexar2.cpp
./src/lexar/Token2.cpp
./src/parser/Parser.cpp
./src/parser/Parser2.cpp
./src/parser/Lexeme.cpp
./src/visitor/Visitor.cpp
./src/semantics/SymbolTable.cpp
./src/semantics/TypeChecker.cpp
./src/errorhandler/SemanticErrorHandler.cpp
./src/errorhandler/SymbolTableErrorHandler.cpp
./src/lexar/Token.cpp
./src/sailfish/sailfishc.cpp
./src/errorhandler/ParserErrorHandler.cpp
./src/errorhandler/Parser2ErrorHandler.cpp
./src/common/ReservedWords.cpp
./src/errorhandler/SemanticAnalyzerErrorHandler.cpp
./src/main/CommandLine.cpp
./src/transpiler/Transpiler.cpp
./src/semantics/SymbolTable.cpp
./src/stdlib_c/stdlib_c.cpp
./src/stdlib_c/Lists.cpp
)

add_executable(sailfishc ./src/main/main.cpp ${DirSOURCES})
Expand Down
10 changes: 0 additions & 10 deletions README.md
Expand Up @@ -16,16 +16,6 @@ For now, you can either build from source:

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

## Development

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:
```
cd test
cmake CMakeLists.txt
make
./sailfishc_tests
```

***

## Sailfish Wiki
Expand Down
44 changes: 0 additions & 44 deletions examples/counter.fish

This file was deleted.

20 changes: 0 additions & 20 deletions examples/fizzbuzz.fish

This file was deleted.

45 changes: 45 additions & 0 deletions examples/intListHandler.fish
@@ -0,0 +1,45 @@
Uat {
[int] list
int size
}

Ufn{
(fun printFoo_(int i)(void){
Tree(
(| i != own.size | {
printInt(getAtIndexInt(own.list, i))
++i
own...printFoo_(i)
})
)
})

(fun printFoo(void)(void){
printStr("List Contents:")
own...printFoo_(0)
})

# rather inefficient because we malloc every time
(fun push(int i)(void){
dec [int] is = [i]
own.list = appendListInt(own.list, is, own.size, 1)
++own.size
})

(fun removeByIndex(int i)(void){
Tree (
( | own.size == 0 | { printStr("Sorry, list is empty!") })
( | true | {
own.list = deleteAtIndexInt(own.list, own.size, i)
--own.size
})
)
})

(fun setAtIndex(int i, int v)(void){
Tree (
( | (i > own.size) or (i < 0) | { printStr("Invalid index") } )
( | true | { own.list = setAtIndexInt(own.list, i, v) })
)
})
}
16 changes: 0 additions & 16 deletions examples/sailfishv2.fish

This file was deleted.

156 changes: 0 additions & 156 deletions examples/stack.fish

This file was deleted.

20 changes: 4 additions & 16 deletions examples/test.fish
@@ -1,18 +1,6 @@
import Foo : "foo.fish"
import intListHandler : "../examples/intListHandler.fish"

Uat {
int i
flt f
}

Ufn {
(fun main(int i)(int){
Tree (
(|1 + 2 == 11 - 12 | {
dec int i = 10
a = 12 + (i - 10)
return a
})
)
})
start {
dec intListHandler i = new intListHandler { size: 100, list: []}
dec [int] is = []
}
17 changes: 0 additions & 17 deletions examples/test2.fish

This file was deleted.

7 changes: 0 additions & 7 deletions examples/test_uda.fish

This file was deleted.

0 comments on commit 79b9894

Please sign in to comment.