Skip to content

Commit

Permalink
remove Kiss.exp() which has been useless
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Dec 10, 2024
1 parent 97df54c commit abdbc97
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
31 changes: 1 addition & 30 deletions src/kiss/Kiss.hx
Original file line number Diff line number Diff line change
Expand Up @@ -320,36 +320,7 @@ class Kiss {
}

#end
public static macro function exp(kissCode:ExprOf<String>) {
var pos = kissCode.pos;
var pos = PositionTools.getInfos(pos);
var kissCode = ExprTools.getValue(kissCode);

var content = File.getContent(pos.file).substr(0, pos.min);
var lines:kiss.List<String> = content.split('\n');
var lineNumber = lines.length;
var column = lines[-1].length + 1;
var pos = {
file: pos.file,
absoluteChar: pos.min,
line: lineNumber,
column: column
};

return _try(() -> {
var exp = null;
var stream = Stream.fromString(kissCode, pos);
var k = defaultKissState();
Reader.readAndProcess(stream, k, (nextExp) -> {
if (exp == null) {
exp = readerExpToHaxeExpr(nextExp, k);
} else {
throw KissError.fromExp(nextExp, "can't have multiple top-level expressions in Kiss.exp() input");
}
});
return exp;
});
}

#if macro
static function addContextFields(k:KissState, useClassFields:Bool) {
if (useClassFields) {
Expand Down
4 changes: 0 additions & 4 deletions src/test/cases/BasicTestCase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ class BasicTestCase extends Test {
_testHaxeInsertion();
}

function testKissInsertion() {
Assert.equals(10, Kiss.exp('(+ 5 2 3)'));
}

function testStaticFunction() {
Assert.equals(6, BasicTestCase.myFloor(6.5));
}
Expand Down

0 comments on commit abdbc97

Please sign in to comment.