Skip to content

Commit 8923fed

Browse files
committed
[Lexer] Fix EOF action
1 parent 78cfa29 commit 8923fed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/Util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ std::string handle_indent(int indent, std::string content){
7373
if(indent >= 0){
7474
// measure indent
7575
size_t space_pos = content.find_first_not_of(" \t\n\r\v");
76-
if(space_pos != std::string::npos){
76+
if((space_pos != std::string::npos) && (space_pos != 0)){
7777
std::string spaces = content.substr(0, space_pos);
7878
content = content.substr(space_pos);
7979
content = std::regex_replace(content, std::regex(spaces), "\n" + std::string(indent, ' '));

0 commit comments

Comments
 (0)