ellder054 / gizmo-lang Goto Github PK
View Code? Open in Web Editor NEWGizmo - A fast and user friendly programming language for parsing and manipulating strings
Home Page: http://gizmolang.org
License: GNU General Public License v3.0
Gizmo - A fast and user friendly programming language for parsing and manipulating strings
Home Page: http://gizmolang.org
License: GNU General Public License v3.0
Memory Garbage is inserted when gizmo_llvm_ir.ll is generated, but it only happens sometimes.
When I run each of the file in the afl-output/crashes
directory, they all seem to be working fine. Sometimes I get a gizmo error that says:
error: On line 1
Unexpected character ''
...
Calling a function with no arguments like this:
int a() {
return 5;
}
write(a());
results in this error.
error: On line 4
Unexpected token
write(a());
^
The cause of this problem is that our parser does not allow expressions to be empty.
The parser expects an expression right after the left parenthesis, but instead finds a right parenthesis. It then throws the error above.
When making the expression ast, we need to pass the type of the factor up recursively. If two types don't match, throw an error.
Tokens with a length that overflows the token buffer size need to be handled.
If you use the write function more than once, it apparently frees the value that is passed. Somewhere we use it after it has been freed.
Hi, just here to give you a friendly suggestion that apparently you have a lots of tiny commits for every single tiny changes.
Just use git commit --amend
to override the last commit with the new changes.
Have a nice day!
When someone make a string and prints it, the write function doesn't know how big the string is. We need to create a list to keep track of the length of each string.
For example:
@.str.1: item 0 in the list
@.str.2: item1 in the list
etc...
Most statements assume an array is of the type %.arr, but sometimes (with function arguments and storing a %.arr in another %.arr) it gets messed up and says something is a %.arr even when it is a %.arr* (or vice versa).
Assignments need to be able to support:
list[5] = something
Do to the fact that an assignment is defined as "an identifier followed by the equals sign followed by an expression", this is not allowed.
Most of our built-in functions require the arguments to be a certain type. We need to have a checker in new_Function_call_node that checks the arguments' types.
Here is a code example that fails, :
string[] a = ["abc"];
append(a, "def");
write(a[1]);
while this doesn't:
int[] a = [1];
append(a, 2);
write(a[1]);
When compiling the first code example and running the llvm, you get a seg-fault.
Else-if statements in Gizmo look like this for now:
if true or false {
\ do something
} else if false {
\ do something else
}
Though they are subject to change.
We need an interface to convert between modern gizmo escapes sequences and hex escapes like the ones llvm uses.
We also need to be able to accurately get the correct char length of the strings containing these escapes
Hi, I'm just trying to compile this on windows with MSVC 19.26 (MSVS 2019), but it failed (C2057) because msvc doesn't support variable length arrays (c99). Here is the line that cause the error.
Line 25 in 7aafcea
We have a heap buffer overflow on line 60 in codegen.c
We need to find a good algorithm based on how llvm does their strings.
Everything related to strings in the code generator is not working
Indexes are defined as "an identifier followed by a left bracket followed by an expression followed by a right bracket".
If we could replace the identifier with an expression, we could support things like this:
var = list[index][index]
or:
var = ("abc" + "def")[0]
Hi, I don't have quite experience with LLVM, I'm thinking about contributing here. Also I want to learn how LLVM works, Is it a frame work that you've integrate or is it a toolchain? Any pointers would be helpful. And just wondering what are the ways I could contribute without code?
The parser needs to check if the value of the sides is zero while parsing division expressions.
It also needs to be smart enough to know identifier's values. This should report an error.
int a = 5;
int b = 0;
write(a / b);
Take this piece of code:
int[] a = [1, 2, 3];
write(len(a));
write(", ");
append(a, 4);
write(len(a));
It prints:
3, 3
But we add one extra element to the list before we print the length for the second time, so the second number should be 4.
Block statements fail due to the fact that all symbol table contexts are popped (except for global) and the code generator wants to use the symbol table, but it can't.
Inline comments fail and all tokens after it are ignored. Inline comments (or multi-line comments) start with \*
and end with */
.
The code generator doesn't know what to do when it finds an expression like this:
"abc" + "def"
This Gizmo code will print out "abc is abcdef" when it should print "abc is not abcdef".
if "abc" == "abcdef" {
write("abc is abcdef\n");
} else {
write("abc is not abcdef\n");
}
How can LLVM divide two integers and return a double.
div
is not an instruction.sdiv
and udiv
convert result to integer.9 / 18
to return a double 0.500000
. Or 10 / 5
to return 2.000000
.The 'not' operator returns the opposite of the given boolean expression. For example, ...
write(not true);
...should output 'false'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.