diff --git a/lexers/embedded/objectpascal.xml b/lexers/embedded/objectpascal.xml
index aac82f916..12af64b9d 100644
--- a/lexers/embedded/objectpascal.xml
+++ b/lexers/embedded/objectpascal.xml
@@ -28,7 +28,7 @@
-
+
@@ -50,8 +50,12 @@
+
+
+
+
-
+
diff --git a/lexers/testdata/objectpascal.actual b/lexers/testdata/objectpascal.actual
index cb49e257d..f80a5a432 100644
--- a/lexers/testdata/objectpascal.actual
+++ b/lexers/testdata/objectpascal.actual
@@ -83,6 +83,8 @@ var
{-NODEFINE string 'String' } {$OBJTYPENAME string 'NUnicodeString'} { defined in ustring.h }
{-EXTERNALSYM ShortInt 'signed char' } {-OBJTYPENAME ShortInt 'Bzc'}
+(*$hints off*) // another valid compiler directive
+
const
CLineBreak = {$IFDEF POSIX} _AnsiStr(#10) {$ENDIF}
{$IFDEF MSWINDOWS} _AnsiStr(#13#10) {$ENDIF};
diff --git a/lexers/testdata/objectpascal.expected b/lexers/testdata/objectpascal.expected
index 189e79a38..67ea6fac4 100644
--- a/lexers/testdata/objectpascal.expected
+++ b/lexers/testdata/objectpascal.expected
@@ -409,6 +409,11 @@
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{-OBJTYPENAME ShortInt 'Bzc'}"},
{"type":"Text","value":"\n\n"},
+ {"type":"CommentPreproc","value":"(*$hints off*)"},
+ {"type":"TextWhitespace","value":" "},
+ {"type":"CommentSingle","value":"// another valid compiler directive"},
+ {"type":"TextWhitespace","value":"\n"},
+ {"type":"Text","value":"\n"},
{"type":"KeywordReserved","value":"const"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
@@ -420,7 +425,7 @@
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"_AnsiStr"},
{"type":"Operator","value":"("},
- {"type":"LiteralNumberHex","value":"#10"},
+ {"type":"LiteralStringEscape","value":"#10"},
{"type":"Operator","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$ENDIF}"},
@@ -430,7 +435,7 @@
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"_AnsiStr"},
{"type":"Operator","value":"("},
- {"type":"LiteralNumberHex","value":"#13#10"},
+ {"type":"LiteralStringEscape","value":"#13#10"},
{"type":"Operator","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$ENDIF}"},
@@ -1725,7 +1730,7 @@
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"Ord"},
{"type":"Operator","value":"("},
- {"type":"LiteralNumberHex","value":"#10"},
+ {"type":"LiteralStringEscape","value":"#10"},
{"type":"Operator","value":")"},
{"type":"Punctuation","value":"."},
{"type":"Text","value":"ToExtended"},
@@ -1947,7 +1952,7 @@
{"type":"Operator","value":"%"},
{"type":"Text","value":"fs"},
{"type":"Operator","value":":("},
- {"type":"LiteralNumberHex","value":"0x2c"},
+ {"type":"LiteralStringEscape","value":"0x2c"},
{"type":"Operator","value":")"},
{"type":"Punctuation","value":","},
{"type":"Operator","value":"%"},