Posted 27 November 2014 - 02:19 AM
Hello CC community!
I am working on making a simple interpreter language supposed to be like a C based language.
I need a syntax that reads a line from a written text file and if it says "print (your text here)" then it will print
the text that the user wrote in the file. So far I have been getting this error and i'm not sure why:
A#:10: attempt to concentrate string and nil
I hope I can find some help, thankyou for reading!
best,
Rob
I am working on making a simple interpreter language supposed to be like a C based language.
I need a syntax that reads a line from a written text file and if it says "print (your text here)" then it will print
the text that the user wrote in the file. So far I have been getting this error and i'm not sure why:
A#:10: attempt to concentrate string and nil
cmd = read()
if cmd=="compile" then
name = read()
local file = fs.open(name, "r")
if file then
local text = file.readLine()
if text=="#include <kernel>" then
local text = file.readLine()
if text==("print"..text) then
print(text)
end
end
end
end
I hope I can find some help, thankyou for reading!
best,
Rob