fix ReaderExp.toString()
This commit is contained in:
@@ -11,6 +11,8 @@ import kiss.Macros;
|
|||||||
import kiss.Types;
|
import kiss.Types;
|
||||||
import kiss.CompileError;
|
import kiss.CompileError;
|
||||||
|
|
||||||
|
using kiss.Reader;
|
||||||
|
|
||||||
typedef KissState = {
|
typedef KissState = {
|
||||||
className:String,
|
className:String,
|
||||||
readTable:Map<String, ReadFunction>,
|
readTable:Map<String, ReadFunction>,
|
||||||
@@ -47,12 +49,13 @@ class Kiss {
|
|||||||
break;
|
break;
|
||||||
var position = stream.position();
|
var position = stream.position();
|
||||||
var nextExp = Reader.read(stream, k.readTable);
|
var nextExp = Reader.read(stream, k.readTable);
|
||||||
#if test
|
|
||||||
trace(nextExp);
|
|
||||||
#end
|
|
||||||
// The last expression might be a comment, in which case None will be returned
|
// The last expression might be a comment, in which case None will be returned
|
||||||
switch (nextExp) {
|
switch (nextExp) {
|
||||||
case Some(nextExp):
|
case Some(nextExp):
|
||||||
|
#if test
|
||||||
|
trace(nextExp.def.toString());
|
||||||
|
#end
|
||||||
var field = readerExpToField(nextExp, k);
|
var field = readerExpToField(nextExp, k);
|
||||||
if (field != null)
|
if (field != null)
|
||||||
classFields.push(field);
|
classFields.push(field);
|
||||||
|
|||||||
@@ -123,17 +123,23 @@ class Reader {
|
|||||||
case CallExp(func, args):
|
case CallExp(func, args):
|
||||||
// (f a1 a2...)
|
// (f a1 a2...)
|
||||||
var str = '(' + func.def.toString();
|
var str = '(' + func.def.toString();
|
||||||
for (arg in args) {
|
if (args.length > 0)
|
||||||
str += arg.def.toString();
|
str += " ";
|
||||||
}
|
str += [
|
||||||
|
for (arg in args) {
|
||||||
|
arg.def.toString();
|
||||||
|
}
|
||||||
|
].join(" ");
|
||||||
str += ')';
|
str += ')';
|
||||||
str;
|
str;
|
||||||
case ListExp(exps):
|
case ListExp(exps):
|
||||||
// [v1 v2 v3]
|
// [v1 v2 v3]
|
||||||
var str = '[';
|
var str = '[';
|
||||||
for (exp in exps) {
|
str += [
|
||||||
str += exp.def.toString();
|
for (exp in exps) {
|
||||||
}
|
exp.def.toString();
|
||||||
|
}
|
||||||
|
].join(" ");
|
||||||
str += ']';
|
str += ']';
|
||||||
str;
|
str;
|
||||||
case StrExp(s):
|
case StrExp(s):
|
||||||
|
|||||||
Reference in New Issue
Block a user