From fd282228769f9bfe829f51c082e37b34efd2eacd Mon Sep 17 00:00:00 2001 From: Tobias Reiher Date: Tue, 3 Sep 2024 13:45:34 +0200 Subject: [PATCH] Fix syntax highlighting for identifiers with numbers or keywords Ref. AdaCore/RecordFlux#1301, eng/recordflux/RecordFlux#1776 --- CHANGELOG.md | 1 + rflx/ide/vscode/syntax/recordflux.tmLanguage.json | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78991db05..ae89ad3c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Generation of uncompilable code for messages with variable as field condition (eng/recordflux/RecordFlux#1762) +- Syntax highlighting for identifiers with numbers or keywords (AdaCore/RecordFlux#1301, eng/recordflux/RecordFlux#1776) ## [0.23.0] - 2024-08-23 diff --git a/rflx/ide/vscode/syntax/recordflux.tmLanguage.json b/rflx/ide/vscode/syntax/recordflux.tmLanguage.json index bf6ec5087..f8c1c1e99 100644 --- a/rflx/ide/vscode/syntax/recordflux.tmLanguage.json +++ b/rflx/ide/vscode/syntax/recordflux.tmLanguage.json @@ -32,13 +32,13 @@ }, { "name": "keyword.other.recordflux", - "match": "\\b(begin|end|with|message|session|package|type|function|is|of|for|use|new|state|transition|exception|generic)" + "match": "\\b(begin|end|with|message|session|package|type|function|is|of|for|use|new|state|transition|exception|generic)\\b" } ] }, "operators": { "name": "entity.name.operator.recordflux", - "match": "=>|=|\\*|\\+|\\-|/=|\\.\\.|<|<=|>|>=|:=|\\b(or|and|range|sequence|'First|'Size|'Last|'Valid_Checksum|'Valid|'Write|'Read)" + "match": "=>|=|\\*|\\+|\\-|/=|\\.\\.|<|<=|>|>=|:=|\\b(or|and|range|sequence|'First|'Size|'Last|'Valid_Checksum|'Valid|'Write|'Read)\\b" }, "strings": { "name": "string.quoted.double.recordflux", @@ -54,15 +54,15 @@ "patterns": [ { "name": "constant.language.recordflux", - "match": "\\b(null|Low_Order_First|High_Order_First|Always_Valid|Readable|Writable)" + "match": "\\b(null|Low_Order_First|High_Order_First|Always_Valid|Readable|Writable)\\b" }, { "name": "constant.numeric.recordflux", - "match": "\\d[0-9_]*(\\.\\d[0-9_]*)?([eE]([-+])?\\d[0-9_]*)?" + "match": "\\b(\\d[0-9_]*(\\.\\d[0-9_]*)?([eE]([-+])?\\d[0-9_]*)?)\\b" }, { "name": "variable.language.recordflux", - "match": "\\b(Size|Byte_Order|Checksum)" + "match": "\\b(Size|Byte_Order|Checksum)\\b" } ] },