From a9d51c01c2e949bd03465c69453e340ea94c3176 Mon Sep 17 00:00:00 2001
From: codiacdev <150445197+codiacdev@users.noreply.github.com>
Date: Sun, 19 Nov 2023 15:10:13 +0100
Subject: [PATCH 1/4] added: another rule for objectpascal lexer
---
lexers/embedded/objectpascal.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lexers/embedded/objectpascal.xml b/lexers/embedded/objectpascal.xml
index aac82f916..ba7516309 100644
--- a/lexers/embedded/objectpascal.xml
+++ b/lexers/embedded/objectpascal.xml
@@ -28,7 +28,7 @@
-
+
From da7549ff08089909691381d0899d3628102395b4 Mon Sep 17 00:00:00 2001
From: codiacdev <150445197+codiacdev@users.noreply.github.com>
Date: Sun, 19 Nov 2023 15:11:41 +0100
Subject: [PATCH 2/4] updated: objectpascal lexer testdata
---
lexers/testdata/objectpascal.actual | 2 ++
lexers/testdata/objectpascal.expected | 5 +++++
2 files changed, 7 insertions(+)
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..e9833b019 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":" "},
From 0ff825689ffa99b0fba819d16526b2374dd7368e Mon Sep 17 00:00:00 2001
From: codiacdev <150445197+codiacdev@users.noreply.github.com>
Date: Thu, 23 Nov 2023 18:25:01 +0100
Subject: [PATCH 3/4] fixed: processing of control (escape) characters
---
lexers/embedded/objectpascal.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lexers/embedded/objectpascal.xml b/lexers/embedded/objectpascal.xml
index ba7516309..12af64b9d 100644
--- a/lexers/embedded/objectpascal.xml
+++ b/lexers/embedded/objectpascal.xml
@@ -50,8 +50,12 @@
+
+
+
+
-
+
From a3fec6cf828ce7b4ed17b4160064577b815b7ef5 Mon Sep 17 00:00:00 2001
From: codiacdev <150445197+codiacdev@users.noreply.github.com>
Date: Thu, 23 Nov 2023 18:26:54 +0100
Subject: [PATCH 4/4] updated: test data for objectpascal lexer
---
lexers/testdata/objectpascal.expected | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lexers/testdata/objectpascal.expected b/lexers/testdata/objectpascal.expected
index e9833b019..67ea6fac4 100644
--- a/lexers/testdata/objectpascal.expected
+++ b/lexers/testdata/objectpascal.expected
@@ -425,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}"},
@@ -435,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}"},
@@ -1730,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"},
@@ -1952,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":"%"},