From 15388e22f7acd490951859bcc7d1c7359aca7990 Mon Sep 17 00:00:00 2001 From: John Till Date: Sat, 2 Nov 2024 21:24:52 +0000 Subject: [PATCH] Create variable for magic number --- src/forscape_scanner.cpp | 2 +- src/forscape_unicode.h | 2 ++ src/typeset_controller.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/forscape_scanner.cpp b/src/forscape_scanner.cpp index c5f73e9..0f9b3bf 100644 --- a/src/forscape_scanner.cpp +++ b/src/forscape_scanner.cpp @@ -51,7 +51,7 @@ void Scanner::scanToken() alloc_except { case '_': scanIdentifier(); break; #endif - case 3: close(); break; + case SCANNER_NUMBER_END_CONSTRUCT: close(); break; case '\n': newline(); break; case '\0': endOfFile(); break; diff --git a/src/forscape_unicode.h b/src/forscape_unicode.h index 1db7d8c..116e86f 100644 --- a/src/forscape_unicode.h +++ b/src/forscape_unicode.h @@ -6,6 +6,8 @@ #include #include +#define SCANNER_NUMBER_END_CONSTRUCT 3 + namespace Forscape { inline constexpr size_t codepointSize(uint8_t ch) noexcept { diff --git a/src/typeset_controller.cpp b/src/typeset_controller.cpp index 9d00a68..5e705c4 100644 --- a/src/typeset_controller.cpp +++ b/src/typeset_controller.cpp @@ -842,7 +842,7 @@ uint32_t Controller::scan() noexcept { return constructScannerCode(c->constructCode()); }else if(isNested()){ active.setToFrontOf(subphrase()->textRightOfSubphrase()); - return 3; + return SCANNER_NUMBER_END_CONSTRUCT; }else if(Line* l = nextLine()){ active.setToFrontOf(l); return '\n';