kphp icon indicating copy to clipboard operation
kphp copied to clipboard

improve `#define` directives handling during the preprocessing

Open quasilyte opened this issue 4 years ago • 0 comments

Right now, user can't write #define FFI_LIB "foo.so" (note: several spaces between the FFI_LIB and string literal). PHP does support this, so KPHP should as well.

The relevant code looks like this: https://github.com/VKCOM/kphp/blob/ff4e29f8cda8455350fc4c3079899292bb3e6dac/compiler/ffi/ffi_parser.cpp#L38-L52

That code could also benefit from some unit tests that make sure that preprocessed source keeps the lines number.

quasilyte avatar Nov 11 '21 17:11 quasilyte