-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4191 from masatake/jsx
JavaScript,HTML: skip JSX elements
- Loading branch information
Showing
14 changed files
with
353 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--sort=no | ||
--extras=+r | ||
--fields=+lr |
8 changes: 8 additions & 0 deletions
8
Units/parser-javascript.r/simple-jsx-no-guest.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
foo input.jsx /^function foo() {$/;" f language:JavaScript roles:def | ||
Comp1 input-0.jsx /^const Comp1 = () => {$/;" f language:JavaScript roles:def | ||
x input-0.jsx /^ const x = (arg) => console.log(arg)$/;" f language:JavaScript function:Comp1 roles:def | ||
Comp2 input-0.jsx /^const Comp2 = (props) => {$/;" f language:JavaScript roles:def | ||
Comp3 input-0.jsx /^const Comp3 = (str) => {$/;" f language:JavaScript roles:def | ||
Comp4 input-0.jsx /^const Comp4 = (str) => {$/;" f language:JavaScript roles:def | ||
Comp5 input-0.jsx /^const Comp5 = (str) => {$/;" f language:JavaScript roles:def | ||
z0 input-0.jsx /^var z0$/;" v language:JavaScript roles:def |
36 changes: 36 additions & 0 deletions
36
Units/parser-javascript.r/simple-jsx-no-guest.d/input-0.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const Comp1 = () => { | ||
const x = (arg) => console.log(arg) | ||
x(4) | ||
return(<Comp2 text={<p>Some Text</p>}/>) | ||
} | ||
|
||
const Comp2 = (props) => { | ||
return ( | ||
props.text | ||
) | ||
} | ||
|
||
const Comp3 = (str) => { | ||
return(<div> | ||
<h1>hello</h1> | ||
something: {str} | ||
<h1>bye</h1> | ||
</div>) | ||
} | ||
|
||
const Comp4 = (str) => { | ||
return(<> | ||
<h1>bonjour</h1> | ||
something: {str} | ||
{<h2>frag{subtitle}ment</h2>} | ||
<h1>au revoir</h1> | ||
</>) | ||
} | ||
|
||
const Comp5 = (str) => { | ||
return <x/> | ||
} | ||
|
||
var z0 | ||
|
||
// Taken from https://stackoverflow.com/questions/79395369/why-does-universal-ctags-fail-to-record-some-functions-in-the-tags-file-for-a-pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function foo() { | ||
var x = <div> | ||
<Menu /> | ||
<div>; | ||
|
||
return x; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--sort=no | ||
--extras=+{guest}r | ||
--fields=+lr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
foo input.jsx /^function foo() {$/;" f | ||
foo input.jsx /^function foo() {$/;" f language:JavaScript roles:def | ||
Comp1 input-0.jsx /^const Comp1 = () => {$/;" f language:JavaScript roles:def | ||
x input-0.jsx /^ const x = (arg) => console.log(arg)$/;" f language:JavaScript function:Comp1 roles:def | ||
Comp2 input-0.jsx /^const Comp2 = (props) => {$/;" f language:JavaScript roles:def | ||
Comp3 input-0.jsx /^const Comp3 = (str) => {$/;" f language:JavaScript roles:def | ||
hello input-0.jsx /^ <h1>hello<\/h1>$/;" h language:HTML roles:def | ||
bye input-0.jsx /^ <h1>bye<\/h1>$/;" h language:HTML roles:def | ||
Comp4 input-0.jsx /^const Comp4 = (str) => {$/;" f language:JavaScript roles:def | ||
bonjour input-0.jsx /^ <h1>bonjour<\/h1>$/;" h language:HTML roles:def | ||
frag ment input-0.jsx /^ {<h2>frag{subtitle}ment<\/h2>}$/;" i language:HTML roles:def | ||
au revoir input-0.jsx /^ <h1>au revoir<\/h1>$/;" h language:HTML roles:def | ||
Comp5 input-0.jsx /^const Comp5 = (str) => {$/;" f language:JavaScript roles:def | ||
z0 input-0.jsx /^var z0$/;" v language:JavaScript roles:def |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const Comp1 = () => { | ||
const x = (arg) => console.log(arg) | ||
x(4) | ||
return(<Comp2 text={<p>Some Text</p>}/>) | ||
} | ||
|
||
const Comp2 = (props) => { | ||
return ( | ||
props.text | ||
) | ||
} | ||
|
||
const Comp3 = (str) => { | ||
return(<div> | ||
<h1>hello</h1> | ||
something: {str} | ||
<h1>bye</h1> | ||
</div>) | ||
} | ||
|
||
const Comp4 = (str) => { | ||
return(<> | ||
<h1>bonjour</h1> | ||
something: {str} | ||
{<h2>frag{subtitle}ment</h2>} | ||
<h1>au revoir</h1> | ||
</>) | ||
} | ||
|
||
const Comp5 = (str) => { | ||
return <x/> | ||
} | ||
|
||
var z0 | ||
|
||
// Taken from https://stackoverflow.com/questions/79395369/why-does-universal-ctags-fail-to-record-some-functions-in-the-tags-file-for-a-pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.