-
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.
Finished the tokenizer, will now move on to making the AST. Currently supports most operations. GNU GPL v3.
- Loading branch information
0 parents
commit 9193472
Showing
11 changed files
with
3,777 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,18 @@ | ||
BasedOnStyle: LLVM | ||
UseTab: Always | ||
TabWidth: 4 | ||
IndentWidth: 4 | ||
|
||
BreakBeforeBraces: Attach | ||
AllowShortIfStatementsOnASingleLine: true | ||
IndentCaseLabels: false | ||
IndentPPDirectives: BeforeHash | ||
SpacesInLineCommentPrefix: | ||
Minimum: 1 | ||
Maximum: -1 | ||
EmptyLineBeforeAccessModifier: Always | ||
SeparateDefinitionBlocks: Always | ||
SpaceBeforeInheritanceColon: true | ||
BreakInheritanceList: BeforeColon | ||
IndentAccessModifiers: False | ||
AccessModifierOffset: -4 |
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,9 @@ | ||
.DS_Store | ||
.idea | ||
*.log | ||
tmp/ | ||
|
||
obj/ | ||
bin/ | ||
*.make | ||
Makefile |
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 @@ | ||
# FoxLang Compiler | ||
|
||
LLVM moment | ||
|
||
thats gonna be fun | ||
|
||
Anyway this uses premake. just run `premake5 [build env, such as gmake2 for makefiles]` after installing premake5. | ||
|
||
## We are at the cutting edge of compiler technology | ||
|
||
just look at this code (Also it would be cool if there was a gh style for FoxLang) | ||
|
||
``` fox | ||
if (true) { | ||
🦊println("Hello World!") | ||
} | ||
``` | ||
|
||
there will never be any indentation arguments again! | ||
|
||
Also if i ever make a formatter, there will be only one idomatic style. |
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 @@ | ||
function getOS() | ||
-- ask LuaJIT first | ||
if jit then | ||
return jit.os | ||
end | ||
|
||
-- Unix, Linux variants | ||
local fh,err = assert(io.popen("uname -o 2>/dev/null","r")) | ||
if fh then | ||
osname = fh:read() | ||
end | ||
|
||
return osname or "Windows" | ||
end | ||
|
||
newaction { | ||
trigger = "format", | ||
description = "Formats all code files to comply with formatting spec", | ||
execute = function() | ||
-- print(os.execute("pwd")) | ||
local seperator = package.config:sub(1,1); | ||
-- print("String" .. "Concat") | ||
-- print(debug.getinfo(1).source) | ||
local currentluasourcefile = debug.getinfo(1).source; | ||
local pwd = currentluasourcefile:sub(2, string.len(currentluasourcefile) - 20); | ||
print(pwd) | ||
local src = io.popen([[pwd .. "/src"]]):lines(); | ||
print(src) | ||
for dir in io.popen(pwd .. "/src"):lines() do print(dir) end; | ||
print(getOS()) | ||
print(getOS():contains("Linux")) | ||
package.path = package.path .. ";" .. pwd .. seperator .. "premake" .. seperator .. "?.lua" | ||
.. ";" .. pwd .. seperator .. "premake" .. seperator .. "?" .. seperator .. "init.lua"; | ||
print(package.path) | ||
local dir = require "pl.dir" | ||
print(dir.getallfiles()) | ||
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
workspace "FoxLang" | ||
architecture "x86_64" | ||
configurations { "Debug", "", "Release" } | ||
|
||
project "FoxLang" | ||
kind "ConsoleApp" | ||
language "C++" | ||
cppdialect "C++17" | ||
targetdir "bin/%{cfg.system}-%{cfg.buildcfg}-%{cfg.architecture}" | ||
|
||
files { | ||
"src/**.hpp", | ||
"src/**.h", | ||
"src/**.cpp", | ||
"vendor/*/**.hpp", | ||
"vendor/*/**.h" | ||
} | ||
|
||
includedirs { | ||
"src", | ||
"vendor/*" | ||
} | ||
|
||
filter "configurations:Debug" | ||
defines { "FOX_DEBUG" } | ||
symbols "On" | ||
warnings "Extra" | ||
|
||
filter "configurations:Release" | ||
defines { "FOX_RELEASE" } | ||
optimize "On" | ||
warnings "Default" | ||
|
||
include "premake/actions.lua" |
Oops, something went wrong.