Skip to content

Commit

Permalink
Remove information comments and add Readme to ecma
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuph Gammut committed Jun 28, 2023
1 parent 0354e90 commit be1aba8
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 300 deletions.
14 changes: 14 additions & 0 deletions runtime/queries/ecma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Inheritance model for ecma-based languages

Ecma-based languages share many traits. Because of this we want to share as many queries as possible while avoiding nested inheritance that can make query behaviour unpredictable due to unexpected precedence.

To achieve that, there are "public" and "private" versions for javascript, jsx, and typescript query files, that share the same name, but the "private" version name starts with an underscore (with the exception of ecma, that already exists as a sort of base "private" language). This allows the "private" versions to host the specific queries of the language excluding any `; inherits` statement, in order to make them safe to be inherited by the "public" version of the same language and other languages as well. The tsx language doesn't have a "private" version given that currently it doesn't need to be inherited by other languages.

| Language | Inherits from |
| ---------- | ----------------------- |
| javascript | _javascript, ecma |
| jsx | _jsx, _javascript, ecma |
| typescript | _typescript, ecma |
| tsx | _jsx, _typescript, ecma |

If you intend to add queries to any of the ecma-based languages above, make sure you add them to the correct private language they belong to, so that other languages down the line can benefit from them.
13 changes: 1 addition & 12 deletions runtime/queries/javascript/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/javascript/indents.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/javascript/injections.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/javascript/locals.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/javascript/tags.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/javascript/textobjects.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/jsx/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/jsx/indents.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/jsx/injections.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/jsx/locals.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/jsx/tags.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_javascript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/jsx/textobjects.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_javascript,ecma
15 changes: 1 addition & 14 deletions runtime/queries/tsx/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; Tsx does not have a "private" version given it doesn't need to be inherited by
; other languages. If you plan to add queries to this language, you can add
; them here or consider adding them to any of the inherited languages listed
; below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_typescript,ecma
15 changes: 1 addition & 14 deletions runtime/queries/tsx/indents.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; Tsx does not have a "private" version given it doesn't need to be inherited by
; other languages. If you plan to add queries to this language, you can add
; them here or consider adding them to any of the inherited languages listed
; below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_typescript,ecma
15 changes: 1 addition & 14 deletions runtime/queries/tsx/injections.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; Tsx does not have a "private" version given it doesn't need to be inherited by
; other languages. If you plan to add queries to this language, you can add
; them here or consider adding them to any of the inherited languages listed
; below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_typescript,ecma
15 changes: 1 addition & 14 deletions runtime/queries/tsx/locals.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; Tsx does not have a "private" version given it doesn't need to be inherited by
; other languages. If you plan to add queries to this language, you can add
; them here or consider adding them to any of the inherited languages listed
; below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_typescript,ecma
15 changes: 1 addition & 14 deletions runtime/queries/tsx/tags.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; Tsx does not have a "private" version given it doesn't need to be inherited by
; other languages. If you plan to add queries to this language, you can add
; them here or consider adding them to any of the inherited languages listed
; below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_typescript,ecma
15 changes: 1 addition & 14 deletions runtime/queries/tsx/textobjects.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; Tsx does not have a "private" version given it doesn't need to be inherited by
; other languages. If you plan to add queries to this language, you can add
; them here or consider adding them to any of the inherited languages listed
; below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _jsx,_typescript,ecma
13 changes: 1 addition & 12 deletions runtime/queries/typescript/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
; Ecma based languages share many traits. Because of this we want to share as
; many queries as possible while avoiding nested inheritance that can make
; query behavior unpredictable due to unexpected precedence. To achieve that,
; some ecma related languages have "public" and "private" versions that share
; the same name, but the "private" version name starts with an underscore (with
; the exception of ecma, that works as the base "private" language). This
; allows the "private" versions to host the specific queries of the language
; excluding any "inherits" statement, in order to make them safe to be
; inherited by the "public" version of the same language and other languages
; as well.
; If you plan to add queries to this language, please consider adding them to
; any of the inherited languages listed below.
; See runtime/queries/ecma/README.md for more info.

; inherits: _typescript,ecma
Loading

0 comments on commit be1aba8

Please sign in to comment.