Skip to content

Commit

Permalink
Create variable for magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDTill committed Nov 2, 2024
1 parent 7496dcf commit 15388e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/forscape_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/forscape_unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <string>
#include <unicode_zerowidth.h>

#define SCANNER_NUMBER_END_CONSTRUCT 3

namespace Forscape {

inline constexpr size_t codepointSize(uint8_t ch) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion src/typeset_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 15388e2

Please sign in to comment.