Variable: syntax-propertize-function

Mode-specific function to apply `syntax-table' text properties.
The value of this variable is a function to be called by Font
Lock mode, prior to performing syntactic fontification on a
stretch of text. It is given two arguments, START and END: the
start and end of the text to be fontified. Major modes can
specify a custom function to apply `syntax-table' properties to
override the default syntax table in special cases.

The specified function may call `syntax-ppss' on any position
before END, but it should not call `syntax-ppss-flush-cache',
which means that it should not call `syntax-ppss' on some
position and later modify the buffer on some earlier position.