cpp-programming

Simple C++ programs
git clone git://git.laack.co/cpp-programming.git
Log | Files | Refs | README

commit d19ab0f0445f5cb1dfe91bf24badfd53129b3f34
parent 7f61fcc2adcf4823a9325adb3031b23e6542f5a0
Author: Andrew Laack <andrew@laack.co>
Date:   Wed, 21 Oct 2026 16:34:19 -0500

Multi-line comments

Diffstat:
Mlox/main.lox | 13+++++--------
Mlox/scanner.cpp | 13+++++++++++++
2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/lox/main.lox b/lox/main.lox @@ -1,8 +1,5 @@ -var something = "some value" -if(something == "some value") { - print something -} else { - print "what" -} -var nm = 10.10"this""is""a""test" "123" "456" -var nm = 10.10.101.1.13.2 +/* This is +a multi +line comment*/ + +/**/numfirst = 10.1 diff --git a/lox/scanner.cpp b/lox/scanner.cpp @@ -234,6 +234,19 @@ class Scanner { while(peek() != '\n' && current < source.size()) { advance(); } + } else if(match('*')) { + while((peek() != '*' && doublePeek() != '/' ) && current < source.size()) { + advance(); + } + + if(current < source.size()) { + advance(); + } + + if(current < source.size()) { + advance(); + } + } else { addToken(TokenType::SLASH); }