Syntax of binary Constants
There is a file (binary.h) with every possible permutation of number between 0 and 255 represented as binary in it. They're stored as C-preprocessor macros:

#define B0 0
#define B00 0
#define B000 0
#define B0000 0
#define B00000 0
#define B000000 0
#define B0000000 0
#define B00000000 0
#define B1 1
#define B01 1
#define B001 1
#define B0001 1
#define B00001 1
#define B000001 1
#define B0000001 1
#define B00000001 1
#define B10 2
#define B010 2
#define B0010 2
#define B00010 2
#define B000010 2
#define B0000010 2
#define B00000010 2
... etc ...


Quite why Arduino decided to do this is anyone's guess.  It makes, as you have seen, for non-portable code.

Personally, I never use (and would never recommend any one else should use) those macros, and instead use the GCC standard binary literal representation 0b.....