Skip to content

Commit

Permalink
fixes #24 added new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EmranMR committed Aug 18, 2023
1 parent f20858b commit e34a115
Show file tree
Hide file tree
Showing 5 changed files with 41,031 additions and 40,352 deletions.
54 changes: 43 additions & 11 deletions corpus/conflicts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
Orphan Punctuation Marks
==================

@ { } {} () !
@ { } {} () ! ( )

---

(blade
(php)
(php)
(php)
(php)
(php)
(php)
(php)
Expand All @@ -28,13 +32,41 @@ test@test.com

---

(blade
(php)
(php)
(php)
(php)
(conditional
(directive_start)
(parameter)
(php)
(directive_end)))
(blade
(php)
(php)
(php)
(php)
(conditional
(directive_start)
(parameter)
(php)
(directive_end)))

==================
Comments Ending with Punctuation Conflict
==================

{{--)--}}
{{--}--}}
{{--@--}}
{{--!--}}

---
(blade
(comment
(bracket_start)
(text)
(bracket_end))
(comment
(bracket_start)
(text)
(bracket_end))
(comment
(bracket_start)
(text)
(bracket_end))
(comment
(bracket_start)
(text)
(bracket_end)))
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ module.exports = grammar({
// !text
text: ($) =>
choice(
token(prec(-1, /[{}!@()?-][a-zA-Z\d]*[^\(]/)), // custom directive conflict resolution
token(prec(-1, /@[a-zA-Z\d]*[^\(-]/)), // custom directive conflict resolution
token(prec(-2, /[{}!@()?-]/)), // orphan tags
token(
prec(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tree-sitter-blade",
"version": "0.3.1",
"version": "0.3.2",
"description": "tree-sitter-blade for Laravel Blade files",
"main": "bindings/node",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@
"value": -1,
"content": {
"type": "PATTERN",
"value": "[{}!@()?-][a-zA-Z\\d]*[^\\(]"
"value": "@[a-zA-Z\\d]*[^\\(-]"
}
}
},
Expand Down
Loading

0 comments on commit e34a115

Please sign in to comment.