emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/web-mode 10f1269ab1: fix blade lexing


From: ELPA Syncer
Subject: [nongnu] elpa/web-mode 10f1269ab1: fix blade lexing
Date: Fri, 1 Mar 2024 07:00:59 -0500 (EST)

branch: elpa/web-mode
commit 10f1269ab1007ab3d5fe018c83bb82c979617bfd
Author: fxbois <fxbois@gmail.com>
Commit: fxbois <fxbois@gmail.com>

    fix blade lexing
    
    #1300
---
 issues/1300.blade.php | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 web-mode.el           | 16 +++++++++------
 2 files changed, 65 insertions(+), 6 deletions(-)

diff --git a/issues/1300.blade.php b/issues/1300.blade.php
new file mode 100644
index 0000000000..0c05f96d03
--- /dev/null
+++ b/issues/1300.blade.php
@@ -0,0 +1,55 @@
+<div>
+
+  <span>@lang('consumption.this_month')</span>
+
+  Hello, {!! $name !!}.
+
+  {{ isset($name) ? $name : 'Default' }}
+
+  @{{ This will not be processed by Blade }}
+
+  @component
+    toto
+  @endcomponent
+
+  {{-- This comment will not be in the rendered HTML --}}
+
+  @section('title', 'Page Title')
+
+  @if (count($records) === 1)
+    I have one record!
+  @elseif (count($records) > 1)
+    I have multiple records!
+  @else
+    I don't have any records!
+  @endif
+
+  @unless (Auth::check())
+    You are not signed in.
+  @endunless
+
+  Anothter example:
+
+  @section('box-content')
+
+    <h4>Item </h4>
+    {!!Form::open( ['route' => ['menu.store'] , 'id' => 'form'])!!}
+
+    @section('list.item.content')
+      <p>This is an item of type {{$item->type}}</p>
+    @overwrite
+
+    <div>
+      @section('sidebar')
+        This is themaster sidebar.
+      @show
+      <div class="container">
+        @yield('content')
+      </div>
+    </div>
+
+  @show
+
+</div>
+
+<span>@choice('foo', 2)</span>
diff --git a/web-mode.el b/web-mode.el
index e17881f3ba..44886ac4d8 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -2,7 +2,7 @@
 
 ;; Copyright 2011-2024 François-Xavier Bois
 
-;; Version: 17.3.18
+;; Version: 17.3.19
 ;; Author: François-Xavier Bois
 ;; Maintainer: François-Xavier Bois <fxbois@gmail.com>
 ;; Package-Requires: ((emacs "23.1"))
@@ -23,7 +23,7 @@
 
 ;;---- CONSTS 
------------------------------------------------------------------
 
-(defconst web-mode-version "17.3.18"
+(defconst web-mode-version "17.3.19"
   "Web Mode version.")
 
 ;;---- GROUPS 
------------------------------------------------------------------
@@ -4281,6 +4281,7 @@ Also return non-nil if it is the command 
`self-insert-command' is remapped to."
 
 (defun web-mode-blade-skip (pos)
   (let (regexp char inc continue found (reg-beg pos) (reg-end (point-max)))
+    ;;(message "pos=%S" pos)
     (goto-char pos)
     (forward-char)
     (skip-chars-forward "a-zA-Z0-9_-")
@@ -4289,16 +4290,16 @@ Also return non-nil if it is the command 
`self-insert-command' is remapped to."
             inc 0)
       (while (and (not found) (re-search-forward regexp reg-end t))
         (setq char (char-before))
-        ;;(message "pos=%S char=%c" (point) char)
+        ;;(message "point=%S char=%c inc=%S" (point) char inc)
         (cond
          ((eq char ?\()
           (setq inc (1+ inc)))
          ((eq char ?\))
           (cond
            ((and (not (eobp))
-                (eq (char-after) ?\))
-                (< inc 2))
+                 (< inc 2))
             (forward-char)
+            (setq inc (1- inc))
             (setq found t)
             )
            ((> inc 0)
@@ -4318,8 +4319,11 @@ Also return non-nil if it is the command 
`self-insert-command' is remapped to."
             )
           )
          ) ;cond
+        ;;(message "inc=%S found=%S" inc found)
         ) ;while
-    ) ; when
+      ) ; when
+    ;;(message "point=%S inc=%S" (point) inc)
+    (when found (backward-char))
   ))
 
 (defun web-mode-velocity-skip (pos)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]