Closed meffie closed 5 years ago
That was intentional as I wanted to keep the input buffer separate from the program functions, so that it does not accidentally modifies it. Even though makePoeticAssignment() only reads the buffer, still I kept it that way for the sake of uniformity.
I see. Shouldn't the function just declare the argument as const and let the compiler make that enforcement?
Haha, I feel embarrassed. As you can tell, I don't much experience in making software. That should be the correct way of implementing. I am merging this as of now and will be fixing the function declaration soon.
Don't be embarrassed! There is always different ways to write code! It's good to have working code, and make improvements over time.
The poetic literal is evaluated in place, so it is not neccessary to create a copy of it and then free the copy in the parser action. This also simplifies the parser.