Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tristanisham/fan
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanisham committed May 28, 2024
2 parents 9cb567f + 12eaa3d commit 9759afa
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 145 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"cmake.configureOnOpen": true
"cmake.configureOnOpen": true,
"files.eol": "\n"
}
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
########################

# Add back: fsanitize=leak
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fasynchronous-unwind-tables -ggdb3 -Wall -fsanitize=leak -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fasynchronous-unwind-tables -ggdb3 -Wall -fsanitize=leak -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -flto=auto")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=leak -fsanitize=address -fsanitize=undefined -no-pie -Wall -fno-omit-frame-pointer")

########################
# RELEASE #
########################
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIE -D_FORTIFY_SOURCE=2 -fexceptions -Wall -O2 -flto -funroll-loops")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIE -D_FORTIFY_SOURCE=2 -fexceptions -Wall -O2 -flto=auto -funroll-loops")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_LINKER_FLAGS_RELEASE} -fPIE -s")
# -static -static-libgcc -static-libstdc++
elseif(MSVC)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# Fan

Fan is a dynamically-typed programmign language based on
[Wren](https://wren.io). Fan's aim is to be _statically compilable_, portable,
Fan is a dynamically-typed programming language. It is based on
[Wren](https://wren.io), but features significant customizations to its runtime. Fan's aim is to be _statically compilable_, portable,
and come with batteries-included.

```sh
Expand Down
13 changes: 12 additions & 1 deletion fan.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#!/usr/bin/env bash

FAN_LIB=./lang build/debug/fan "$@"

# Check for the existence of the fan executable in different directories
if [[ -x "./build/debug/fan" ]]; then
FAN_EXEC="./build/debug/fan"
elif [[ -x "./build/release/fan" ]]; then
FAN_EXEC="./build/release/fan"
else
FAN_EXEC="./build/fan"
fi

# Execute the fan command with the given arguments
FAN_LIB=./lang $FAN_EXEC "$@"
2 changes: 2 additions & 0 deletions include/lib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,6 @@ namespace encoding {
void md_to_html(WrenVM* vm);
}



} // namespace lib
7 changes: 0 additions & 7 deletions tests/encoding.fan

This file was deleted.

55 changes: 0 additions & 55 deletions tests/env.fan

This file was deleted.

7 changes: 0 additions & 7 deletions tests/fmt.fan

This file was deleted.

5 changes: 0 additions & 5 deletions tests/fs_cwd.fan

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fs_test.fan

This file was deleted.

5 changes: 0 additions & 5 deletions tests/http_test.fan

This file was deleted.

7 changes: 0 additions & 7 deletions tests/md_test.fan

This file was deleted.

5 changes: 0 additions & 5 deletions tests/open_file.fan

This file was deleted.

6 changes: 0 additions & 6 deletions tests/proc.fan

This file was deleted.

33 changes: 0 additions & 33 deletions tests/recursive_cb.fan

This file was deleted.

Empty file added tests/std/env_tests
Empty file.
16 changes: 16 additions & 0 deletions tests/std/markdown.fan
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "std/encoding" for Markdown
import "std/fs" for Fs, Path

var files = Fs.listAllRecursive(Fs.cwd())

// List of markdown files in the directory
var mdFiles = []

for (i in files) {
if (Path.ext(i) == "md") {
System.print(i)
mdFiles.add(i)
}
}

System.print(mdFiles.count)
11 changes: 10 additions & 1 deletion valgrind.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/usr/bin/env bash

# Check for the existence of the fan executable in different directories
if [[ -x "./build/debug/fan" ]]; then
FAN_EXEC="./build/debug/fan"
elif [[ -x "./build/release/fan" ]]; then
FAN_EXEC="./build/release/fan"
else
FAN_EXEC="./build/fan"
fi

FAN_LIB=./lang valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--leak-check=full \
--log-file=build/valgrind-out.txt \
./build/fan $@
$(FAN_EXEC) $@

0 comments on commit 9759afa

Please sign in to comment.