Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Herb #5991

Closed
wants to merge 8 commits into from
Closed

Herb #5991

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@
[submodule "vendor/grammars/language-haskell"]
path = vendor/grammars/language-haskell
url = https://github.com/atom-haskell/language-haskell
[submodule "vender/grammars/language-herb"]
path = vendor/grammars/language-herb
url = https://github.com/yoidog/herb-syntax-highlighting
[submodule "vendor/grammars/language-hql"]
path = vendor/grammars/language-hql
url = https://github.com/adidonato/language-hql
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ vendor/grammars/language-haskell:
- text.tex.latex.haskell
vendor/grammars/language-hql:
- source.hql
vendor/grammars/herb-syntax-highlighting:
- source.herb
vendor/grammars/language-html:
- text.html.basic
vendor/grammars/language-igor:
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2495,6 +2495,14 @@ HLSL:
ace_mode: text
tm_scope: source.hlsl
language_id: 145
HERB:
type: programming
color: "#4db34d"
extensions:
- ".herb"
tm_scope: source.herb
ace_mode: herb
language_id: 679725280
HTML:
type: markup
tm_scope: text.html.basic
Expand Down
5 changes: 5 additions & 0 deletions samples/HERB/Block.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
var a = 1;
write a;
}
write a; // error
1 change: 1 addition & 0 deletions samples/HERB/ForStatement.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for (var i = 0; i < 10;) { i = i + 1; write i;}
3 changes: 3 additions & 0 deletions samples/HERB/Function.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
func Welcome(name) { write "Welcome, " + name + ".";}

Welcome("Waleed");
1 change: 1 addition & 0 deletions samples/HERB/HelloWorld.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
write "Hello World!";
5 changes: 5 additions & 0 deletions samples/HERB/IfStatement.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var a = 50;
var b = 50;
if (a == b) {
write "a is equal to b";
}
2 changes: 2 additions & 0 deletions samples/HERB/Variable.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var a = 15;
write a;
2 changes: 2 additions & 0 deletions samples/HERB/WhileStatement.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var e = 0;
while (e < 10) { e = e + 1; write e;}
12 changes: 12 additions & 0 deletions samples/HERB/blockTypes.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 2 Types of blocks in Herb.
//
// Block one line which is like: { var a = 1; write a;}
//
// Normal block which is like: {
// var a = 1;
// write a;
// }
//
// They are the same thing, but i do recommend block one line.
write "Read source file please.";
write "Thank you.";
6 changes: 6 additions & 0 deletions samples/HERB/counter.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
func count(e) {
if (e > 1) count(e - 1);
print e;
}

count(5);
8 changes: 8 additions & 0 deletions samples/HERB/door.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class door {
knock() {
write "You knocked, someone answered the door.";
}
ringdoorbell() {
write "You rang the doorbell, someone answered the door.";
}
}
33 changes: 33 additions & 0 deletions samples/HERB/herbVarMath.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Declaring number variables.
var num1;
var num2;

// Addition.
num1 = 5;
num2 = 10;

var add = num1 + num2;

// Subtraction.
num1 = 24;
num2 = 13;

var subtract = num1 - num2;

// Division.
num1 = 5;
num2 = 5;

var divide = num1 / num2;

// Multiplication.
num1 = 10;
num2 = 10;

var multipliy = num1 * num2;

// Writing the answers on screen.
write add;
write subtract;
write divide;
write multipliy
8 changes: 8 additions & 0 deletions samples/HERB/scriptInteractiveGame.herb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Script interactive game.
var walkCount = 0;
func interact(a) { if (a == "walk") { walkCount = walkCount + 1; write "You walked."; write "Walk count."; write walkCount;} if (a == "look") { }}
write "You can interact with this game inside the source file!";
interact("walk");
interact("walk");
interact("walk");

1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **HAProxy:** [abulimov/atom-language-haproxy](https://github.com/abulimov/atom-language-haproxy)
- **HCL:** [alexlouden/Terraform.tmLanguage](https://github.com/alexlouden/Terraform.tmLanguage)
- **HLSL:** [tgjones/shaders-tmLanguage](https://github.com/tgjones/shaders-tmLanguage)
- **HERB:** [yoidog/herb-syntax-highlighting](https://github.com/yoidog/herb-syntax-highlighting)
- **HTML:** [tree-sitter/tree-sitter-html](https://github.com/tree-sitter/tree-sitter-html) 🐌
- **HTML+ECR:** [atom-crystal/language-crystal](https://github.com/atom-crystal/language-crystal)
- **HTML+EEX:** [elixir-lang/elixir-tmbundle](https://github.com/elixir-lang/elixir-tmbundle)
Expand Down
2 changes: 2 additions & 0 deletions vendor/grammars/herb-syntax-highlighting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# herb-syntax-highlighting
Herb syntax highlighting for Notepad++ (N++).
21 changes: 21 additions & 0 deletions vendor/grammars/herb-syntax-highlighting/license
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Waled Ali

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<NotepadPlus>
<UserLang name="Herb" ext="herb" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00// 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1"></Keywords>
<Keywords name="Operators2"></Keywords>
<Keywords name="Folders in code1, open"></Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close"></Keywords>
<Keywords name="Folders in code2, open"></Keywords>
<Keywords name="Folders in code2, middle"></Keywords>
<Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">write&#x000D;&#x000A;var&#x000D;&#x000A;func&#x000D;&#x000A;and&#x000D;&#x000A;class&#x000D;&#x000A;else&#x000D;&#x000A;for&#x000D;&#x000A;if&#x000D;&#x000A;or&#x000D;&#x000A;return&#x000D;&#x000A;super&#x000D;&#x000A;this&#x000D;&#x000A;while</Keywords>
<Keywords name="Keywords2">nul&#x000D;&#x000A;true&#x000D;&#x000A;false</Keywords>
<Keywords name="Keywords3">+&#x000D;&#x000A;-&#x000D;&#x000A;*&#x000D;&#x000A;/</Keywords>
<Keywords name="Keywords4">==&#x000D;&#x000A;!=&#x000D;&#x000A;&lt;=&#x000D;&#x000A;=&gt;&#x000D;&#x000A;&lt;&#x000D;&#x000A;&gt;</Keywords>
<Keywords name="Keywords5"></Keywords>
<Keywords name="Keywords6"></Keywords>
<Keywords name="Keywords7"></Keywords>
<Keywords name="Keywords8"></Keywords>
<Keywords name="Delimiters"></Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="0080C0" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="008000" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="0000FF" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="FF8000" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="008000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>
31 changes: 31 additions & 0 deletions vendor/licenses/git_submodule/herb-syntax-highlighting.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: herb-syntax-highlighting
version: 99e233e959529ef304d39acb8414ab3fb21ba558
type: git_submodule
homepage: https://github.com/yoidog/herb-syntax-highlighting
license: mit
licenses:
- sources: LICENSE.md
text: |
MIT License

Copyright (c) 2022 Waled Ali

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices: []