From 14df5d0bccdd8a9b682971fc1646aaa732d9d2ba Mon Sep 17 00:00:00 2001
From: gabib <gabibkaminski@gmail.com>
Date: Mon, 30 Dec 2024 12:09:29 -0300
Subject: [PATCH] Updated v.yaml file

---
 runtime/syntax/v.yaml | 64 +++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 36 deletions(-)

diff --git a/runtime/syntax/v.yaml b/runtime/syntax/v.yaml
index f478393879..c97b9f41b5 100644
--- a/runtime/syntax/v.yaml
+++ b/runtime/syntax/v.yaml
@@ -1,71 +1,63 @@
 filetype: v
 
 detect:
+    filename: "\\.v$"
 
 rules:
       # Conditionals and control flow
     - preproc: "\\b(module|import)\\b"
-    - statement: "\\b(if|else|for|match|select|defer|or|unsafe)\\b"
+    - statement: "\\b(if|else|for|match|select|defer|or|unsafe|asm|defer|go|goto|lock|match|or|rlock|select|spawn|unsafe)\\b"
+    - statement: "\\b(sizeof|typeof)\\b"
     - statement: "\\b(break|continue|goto|return)\\b"
-    - type.keyword: "\\b(assert|const|enum|fn|struct|interface|type)\\b"
-    - type.keyword: "\\b(pub|mut|__global)\\b"
+    - statement: "\\b(as|in|is)\\b"
+    - type.keyword: "\\b(assert|const|enum|fn|struct|interface|type|implements|shared|static|union|volatile)\\b"
+    - type.keyword: "\\b(pub|mut|__global|__offsetof)\\b"
 
     - preproc: "\\$\\b(if|else)\\b"
     - identifier.os: "\\b(mac|macos|linux|windows|freebsd|openbsd|netbsd|dragonfly|android|solaris|haiku)\\b"
     - identifier.compiler: "\\b(gcc|tinyc|clang|mingw|msvc|cplusplus)\\b"
     - identifier.platform: "\\b(amd64|aarch64|x64|x32|little_endian|big_endian)\\b"
     - identifier.other: "\\b(debug|test|js|glibc|prealloc|no_bounds_checking)\\b"
+    - constant.bool: "\\b(true|false)\\b"
+    - constant.none: "\\b(none)\\b"
 
-    - identifier.class: "\\b([A-Z][A-Za-z0-9_]*)\\b"
-    - identifier.function: "\\b([a-z_]+\\()"
-    - symbol.operator: "\\b(i[ns])\\b|[-+/*<>!=~*%&:|,.?]"
-    - symbol.attribute:
-        start: "^\\["
-        end: "\\]$"
-        rules:
-            - default: ".*"
-            - symbol: "\\b(deprecated|direct_array_access|if|inline|live|ref_only|typedef|windows_stdcall)\\b"
-
-      # Types
     - type: "\\b(byte|u(16|32|64|128)|i(nt|8|16|64|128)|f(32|64))\\b"
     - type: "\\b(bool|cha[nr]|map|rune|string)\\b"
     - type: "\\b(any(_int|_float)?|size_t|(uint|byte|char|void)ptr)\\b"
     - constant.bool: "\\b(true|false)\\b"
     - constant.none: "\\b(none)\\b"
-
-      # Brackets
-    - symbol.brackets: "(\\{|\\})"
-    - symbol.brackets: "(\\(|\\))"
-    - symbol.brackets: "(\\[|\\])"
-
-      # Numbers and strings
-    - constant.number: "\\b(0b[01_]+)\\b"
-    - constant.number: "\\b(0o[0-7_]+)\\b"
-    - constant.number: "\\b(0x[0-9a-fA-F_]+)\\b"
-    - constant.number: "\\b([0-9_]+)\\b"
-
+    
     - constant.string:
-        start: "\""
-        end: "\""
+        start: "`"
+        end: "`"
         skip: "\\\\."
         rules:
-            - constant.specialChar: "%."
-            - constant.specialChar: "\\\\[abefnrtv'\\\"\\\\]"
-            - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
+            - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
 
     - constant.string:
         start: "'"
         end: "'"
         skip: "\\\\."
         rules:
-            - constant.specialChar: "%."
-            - constant.specialChar: "\\\\[abefnrtv'\\\"\\\\]"
-            - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
+            - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
 
     - constant.string:
-        start: "`"
-        end: "`"
+        start: "\""
+        end: "\""
+        skip: "\\\\."
+        rules:
+            - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
 
+    # Brackets
+    - symbol.brackets: "(\\{|\\})"
+    - symbol.brackets: "(\\(|\\))"
+    - symbol.brackets: "(\\[|\\])"
+
+      # Numbers and strings
+    - constant.number: "\\b(0b[01_]+)\\b"
+    - constant.number: "\\b(0o[0-7_]+)\\b"
+    - constant.number: "\\b(0x[0-9a-fA-F_]+)\\b"
+    - constant.number: "\\b([0-9_]+)\\b"
     - comment:
         start: "//"
         end: "$"