Article 56F7P PNF: Even Though I Passed true to Function, Always Puts false

PNF: Even Though I Passed true to Function, Always Puts false

by
des_a
from LinuxQuestions.org on (#56F7P)
I am creating a suite of languages. Right now, my interpreter, PNF, is not working.

There is a concept of "functions" in my language, which are roughly like a C++ function, and not quite the same as a subroutine in my language.

The problem I am having right now, is that even though I pass true to a function, it passes false. This is a type BOOLEAN, or TBOOLEAN.

This is GPL software. I'm posting this, because I learned that it might be okay to post it:

https://www.linuxquestions.org/quest...74#post6151874

I learned about GitHub here: https://www.linuxquestions.org/quest...01#post6151501

The repository is here: http://github.com/smileynet000/PNF

I know that the problem is somewhere in the file pnf.hpp. I suspect that it changes when I'm calling the function.

This set of tools is my best experience (real world), for developing compilers and interpreters. I have been working on it since I was 15, and with some small help, I believe that I can get it to have all the features of C.

First big goal, a milestone to achieving my actual goal, not really a goal, but milestone: Have all the same features as C, essentially.

I am getting better at debugging, and hopefully, better at posting on linuxquestions.org. Thanks!

Sample test file:
Code:funcdef 0V a(0V);
funcdef 0V b(var a: number);
funcdef 0V c(var b: string, var c: number);
funcdef 0V d(var d: string, var e: number, var f: number);
funcdef 0V e(0V);
funcdef 0V f(0V);
funcdef 0V g(var g: string);
funcdef 0V h(0V);
funcdef 0V i(var h: boolean);
funcdef 0V j(0V);
funcdef var: number k(0V);
funcdef var: boolean l(0V);
funcdef var: number, var: boolean m(0V);
funcdef 0V n(var a: boolean, var b: number);
funcdef 0V o(var a: number);

function 0V a(0V)
{
println "a()";
fret;
};

function 0V b(var a: number)
{
println "b()";
load aload 77;
fparameter 0V b(var a: number) a number number;
print '"';
fparameter 0V b(var a: number) a number;
print;
println '"';
fret;
};

function 0V c(var b: string, var c: number)
{
println "c()";
fret;
};

function 0V d(var d: string, var e: number, var f: number)
{
println "d()";
fret;
};

function 0V e(0V)
{
println "e()";
fret;
};

function 0V f(0V)
{
println "f()";
fret;
};

function 0V g(var g: string)
{
println "g()";
fret;
};

function 0V h(0V)
{
println "h()";
funccall 0V a(0V);
fret;
};

function 0V i(var h: boolean)
{
println "i()";
fparameter 0V i(var h: boolean) h boolean;
println;
fret;
};

function 0V j(0V)
{
println "j()";
funccall 0V h(0V);
fret;
};

function var: number k(0V)
{
println "k()";
load function var: number k(0V) rvalue 0 : 76;
fret;
};

function var: boolean l(0V)
{
println "l()";
load function var: boolean l(0V) rvalue 0 : true;
fret;
};

function var: number, var: boolean m(0V)
{
println "m()";
load function var: number, var: boolean m(0V) rvalue 0 : 75;
load function var: number, var: boolean m(0V) rvalue 1 : true;
fret;
};

function 0V n(var a: boolean, var b: number)
{
println "n()";

print "Values: ";
fparameter 0V n(var a: boolean, var b: number) a boolean;
print;
print " ";
fparameter 0V n(var a: boolean, var b: number) b number;
println;
fret;
};

function 0V o(var a: number)
{
println "o()";

print "Value: ";
fparameter 0V o(var a: number) a number;
println;
fret;
};

funccall 0V a(0V);
funccall 0V b(22);
funccall 0V c("true", 77);
funccall 0V d("hello", 76, 79);
funccall 0V e(0V);
funccall 0V f(0V);
funccall 0V g("not a toy.");
funccall 0V h(0V);
funccall 0V i(true);
funccall 0V j(0V);

println "";
funccall var: number k(0V);
load rvalue 0;
print "The value returned was: ";
println;

println "";
funccall var: boolean l(0V);
load rvalue 0;
print "The value returned was: ";
println;

println "";
funccall var: number, var: boolean m(0V);
load rvalue 0;
print "The first return value was: ";
println;
load rvalue 1;
print "The second return value was: ";
println;

println "";
funccall 0V n(true, 99);

println "";
funccall 0V o(62);

end 0;latest?d=yIl2AUoC8zA latest?i=CZoDaSqoglQ:K00o98UJYyY:F7zBnMy latest?i=CZoDaSqoglQ:K00o98UJYyY:V_sGLiP latest?d=qj6IDK7rITs latest?i=CZoDaSqoglQ:K00o98UJYyY:gIN9vFwCZoDaSqoglQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments