Skip to content

Commit

Permalink
improve Haxe 4.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed May 6, 2023
1 parent 561d64d commit 8543c18
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/hx/strings/CharIterator.hx
Expand Up @@ -110,7 +110,7 @@ class CharIterator {
return new CharPos(index, line, col);


function new(prevBufferSize:Int)
inline function new(prevBufferSize:Int)
prevBuffer = prevBufferSize > 0 ? new RingBuffer<CharWithPos>(prevBufferSize + 1 /*currChar*/) : null;


Expand All @@ -124,7 +124,7 @@ class CharIterator {
*
* @throws haxe.io.Eof if no previous character is available
*/
public function prev():Char {
public final function prev():Char {
if (!hasPrev())
throw new Eof();

Expand All @@ -150,8 +150,7 @@ class CharIterator {
*
* @throws haxe.io.Eof if no more characters are available
*/
@:final
public function next():Char {
public final function next():Char {
if (prevBufferNextIdx > -1) {
var prevChar = @:nullSafety(Off) prevBuffer[prevBufferNextIdx];
currChar = prevChar.char;
Expand Down
2 changes: 1 addition & 1 deletion src/hx/strings/Pattern.hx
Expand Up @@ -227,7 +227,7 @@ interface Matcher {
*
* @author Sebastian Thomschke, Vegard IT GmbH
*/
@:enum
#if (haxe_ver < 4.3) @:enum #else enum #end
abstract MatchingOption(String) {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hx/strings/Strings.hx
Expand Up @@ -4333,7 +4333,7 @@ class StringDiff {
/**
* Specifies the default value to be used if a given substring was not found in a string operation
*/
@:enum
#if (haxe_ver < 4.3) @:enum #else enum #end
abstract StringNotFoundDefault(Int) {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hx/strings/ansi/AnsiColor.hx
Expand Up @@ -5,7 +5,7 @@
*/
package hx.strings.ansi;

@:enum
#if (haxe_ver < 4.3) @:enum #else enum #end
abstract AnsiColor(Int) {
final BLACK = 0;
final RED = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/hx/strings/ansi/AnsiTextAttribute.hx
Expand Up @@ -8,7 +8,7 @@ package hx.strings.ansi;
/**
* https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_codes
*/
@:enum
#if (haxe_ver < 4.3) @:enum #else enum #end
abstract AnsiTextAttribute(Int) {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hx/strings/internal/TriState.hx
Expand Up @@ -8,7 +8,7 @@ package hx.strings.internal;
/**
* <b>IMPORTANT:</b> This class it not part of the API. Direct usage is discouraged.
*/
@:enum
#if (haxe_ver < 4.3) @:enum #else enum #end
abstract TriState(Null<Bool>) from Null<Bool> to Null<Bool> {
final TRUE = true;
final FALSE = false;
Expand Down

0 comments on commit 8543c18

Please sign in to comment.