diff --git a/README.md b/README.md index 909ca0f..61e4622 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,10 @@ Update two tags: # Changelog +## Version 0.5.0 + +* **New** Updated Syntax definitions (basic types, hexadecimal values, operators, flow control and others) + ## Version 0.4.1 * **Fix:** Toggle Line/Block Comment not working (issue [#8](https://github.com/alefragnani/vscode-language-pascal/issues/8)) diff --git a/images/vscode-pascal-format-code.gif b/images/vscode-pascal-format-code.gif index 0b015a8..47b8ffe 100644 Binary files a/images/vscode-pascal-format-code.gif and b/images/vscode-pascal-format-code.gif differ diff --git a/images/vscode-pascal-snippets.png b/images/vscode-pascal-snippets.png index 2c3a273..f151338 100644 Binary files a/images/vscode-pascal-snippets.png and b/images/vscode-pascal-snippets.png differ diff --git a/images/vscode-pascal-syntax.png b/images/vscode-pascal-syntax.png index e07c192..8a1594b 100644 Binary files a/images/vscode-pascal-syntax.png and b/images/vscode-pascal-syntax.png differ diff --git a/package.json b/package.json index 0148268..4641729 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pascal", "displayName": "Language Pascal", "description": "Pascal support for Visual Studio Code", - "version": "0.4.1", + "version": "0.5.0", "publisher": "alefragnani", "galleryBanner": { "color": "#4682B4", diff --git a/syntaxes/pascal.tmLanguage b/syntaxes/pascal.tmLanguage index 4bca39b..24d4e4d 100644 --- a/syntaxes/pascal.tmLanguage +++ b/syntaxes/pascal.tmLanguage @@ -21,9 +21,9 @@ match - \b(?i:(absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class|const|contains|default|div|do|do|else|end|except|export|exports|external|far|file|finalization|finally|for|forward|generic|goto|if|implementation|implements|import|in|index|inherited|initialization|interface|interrupt|is|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|override|package|packed|pow|private|program|property|protected|public|published|qualified|raise|read|record|repeat|resident|requires|resourcestring|restricted|segment|set|shl|shr|specialize|stored|then|threadvar|to|try|type|unit|until|uses|value|var|view|virtual|dynamic|overload|reintroduce|while|with|write|xor))\b + \b(?i:(absolute|abstract|all|and_then|array|as|asm|attribute|begin|bindable|case|class|const|contains|default|div|else|end|except|export|exports|external|far|file|finalization|finally|forward|generic|goto|if|implements|import|in|index|inherited|initialization|interrupt|is|label|library|mod|module|name|near|not|object|of|on|only|operator|or_else|otherwise|override|package|packed|pow|private|program|protected|public|published|interface|implementation|qualified|read|record|resident|requires|resourcestring|restricted|segment|set|shl|shr|specialize|stored|then|threadvar|to|try|type|unit|until|uses|var|view|virtual|dynamic|overload|reintroduce|with|write|xor))\b name - keyword.control.pascal + keyword.pascal captures @@ -59,16 +59,76 @@ match - \b(?i:(function|procedure|constructor|destructor))\b\s+(\w+(\.\w+)?) + \b(?i:(function|procedure|constructor|destructor|property|read|write))\b\s+(\w+(\.\w+)?) name meta.function.pascal + + match + \b(?i:(self|result))\b + name + token.variable + + + match + \b(?i:(and|or))\b + name + keyword.operator.pascal + + + match + \b(?i:(break|continue|exit|abort|while|do|for|raise|repeat|until))\b + name + keyword.control.pascal + + + + begin + \{\$ + captures + + 0 + + name + warn-token + + + end + \} + name + warn-token + + + + match + \b(?i:(ansichar|ansistring|boolean|byte|cardinal|char|comp|currency|double|dword|extended|file|integer|int64|longint|longword|nativeint|nativeuint|olevariant|pansichar|pchar|pwidechar|pointer|real|shortint|shortstring|single|smallint|string|uint64|variant|widechar|widestring|word|wordbool))\b + name + storage.support.type.pascal + match \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b name constant.numeric.pascal + + match + \$[0-9a-fA-F]{1,16}\b + name + constant.numeric.pascal + + + match + \b(?i:(true|false|nil))\b + name + constant.language.pascal + + + match + \b(?i:(Assert))\b + name + error-token + begin (^[ \t]+)?(?=--)