Skip to content

Commit

Permalink
Add Lua target
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel59 committed Apr 11, 2016
1 parent f00ae60 commit a9efcd6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions compile-test.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@
--next
-python test/test.py
-cmd python3 test/test.py

--next
-lua test/test.lua
-cmd lua test/test.lua
2 changes: 1 addition & 1 deletion test/TestInternalEncoding.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TestInternalEncoding extends haxe.unit.TestCase {
}

public function test_isValidString() {
#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)
assertTrue(InternalEncoding.isValidString("𩸽あëa"));
assertFalse(InternalEncoding.isValidString("𩸽\xe3\x81ëa"));
assertFalse(InternalEncoding.isValidString("\xc0"));
Expand Down
2 changes: 1 addition & 1 deletion test/TestInternalEncodingIter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TestInternalEncodingIter extends haxe.unit.TestCase {
public function test_InternalEncodingIter() {
var s = "𩸽あëa";
var itr = new InternalEncodingIter(s, 0, s.length);
#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)
var index = [0, 4, 7, 9, 10];
#elseif python
var index = [0, 1, 2, 3, 4];
Expand Down
4 changes: 2 additions & 2 deletions unifill/InternalEncoding.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package unifill;

#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)
private typedef UtfX = Utf8;
#elseif python
private typedef UtfX = Utf32;
Expand All @@ -20,7 +20,7 @@ class InternalEncoding {
public static var internalEncoding(get, never) : String;

static inline function get_internalEncoding() : String
#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)
return "UTF-8";
#elseif python
return "UTF-32";
Expand Down
4 changes: 2 additions & 2 deletions unifill/Unifill.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Unifill {
Returns the code point as Int at position `index` by code points of String `s`.
**/
public static inline function uCharCodeAt(s : String, index : Int) : Int {
#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)
return cast haxe.Utf8.charCodeAt(s, index);
#else
var i = InternalEncoding.offsetByCodePoints(s, 0, index);
Expand Down Expand Up @@ -144,7 +144,7 @@ class Unifill {
Appends the character `c` to StringBuf `sb`.
**/
public static inline function uAddChar(sb : StringBuf, c : CodePoint) : Void {
#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)
Utf8.encodeWith(function(c) sb.addChar(c), c.toInt());
#elseif python
// Utf32.encodeWith(function(c) sb.addChar(c), c.toInt());
Expand Down
2 changes: 1 addition & 1 deletion unifill/Utf16.hx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private class Utf16Impl {

}

#if !(neko || php || cpp || macro || python)
#if !(neko || php || cpp || lua || macro || python)

private abstract StringU16Buffer(StringBuf) {

Expand Down
2 changes: 1 addition & 1 deletion unifill/Utf8.hx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private class Utf8Impl {

}

#if (neko || php || cpp || macro)
#if (neko || php || cpp || lua || macro)

private abstract StringU8(String) {

Expand Down

0 comments on commit a9efcd6

Please sign in to comment.