These are chat archives for ChaiScript/ChaiScript

Nov 2016
Nov 28 2016 12:29

@lefticus I have implemented function cascading for defining objects in chaiscript for my ECS. Currently I need to define my objects like this in chaiscript:


This looks ugly and confusing for many components. Is it somehow possible to write it like this:


As far as I understood it correctly chaiscript stops evaluating an expression at a line break which unfortunately forbids the upper formatting.

Jason Turner
Nov 28 2016 13:44
@StanEpp ChaiScript attempts to continue the expression when it can, but an unfortunate sideeffect of having optional ; at the end of a statement makes it difficult to tell where to start and stop
Nov 28 2016 18:44

Is there maybe a possibility to define a particular character that tells the parser to append the next line to the current one or to continue the expression, e.g. :

factory.defineObject("Diamond") \
.addComp_TouchValue() \
.addComp_TouchDamage() \

It's similar to macro definitions over multiple lines.