-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added syntax for Bend programming language #3330
Open
RohanVashisht1234
wants to merge
6
commits into
zyedidia:master
Choose a base branch
from
RohanVashisht1234:bend
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
501811c
Create buzz.yaml
RohanVashisht1234 0925cdb
Delete runtime/syntax/buzz.yaml
RohanVashisht1234 453ca9d
Merge branch 'zyedidia:master' into bend
RohanVashisht1234 1c964eb
Create bend.yaml
RohanVashisht1234 4bdb01d
Update bend.yaml
RohanVashisht1234 16e08a8
Update bend.yaml
RohanVashisht1234 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,49 @@ | ||
# Author: https://github.com/RohanVashisht1234 | ||
filetype: bend | ||
|
||
detect: | ||
filename: "\\.bend$" | ||
|
||
rules: | ||
# keywords | ||
- statement: "\\b(def|switch|case|return|if|else|when|match|λ|Some|data|let|use|object|fold|open|do|bind|Name|identity|Bool|ask|with)\\b" | ||
# special method names | ||
- symbol.operator: "\\b(bend|None|Nil|Result|type|lambda)\\b" | ||
# definitions | ||
- identifier: "def [a-zA-Z_0-9]+" | ||
# keywords (declaration) | ||
- statement: "\\b(Node|Leaf|Tree)\\b" | ||
# constants (true, false, null, this) | ||
- constant: "\\b(true|false|True|False)\\b" | ||
# constants (types) | ||
- type: "\\b(ud|str|int|float|obj|fib|bool|pat|type|any)\\b\\??" | ||
# parentheses | ||
- symbol.brackets: "([(){}]|\\[|\\])" | ||
# extra operators | ||
- symbol.operator: "(\\+|\\-|\\/|%|\\*|>>|<<|\\\\|\\^|&|~|!>)" | ||
# Comparision operators | ||
- symbol.operator: "(==|!=|<=?|>=?|\\bis\\b|\\?\\?)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried looking at documentation and examples a bit but is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I have removed |
||
# numbers | ||
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal | ||
- constant.number: "\\b0b(_?[01])+\\b" # bin | ||
- constant.number: "\\b0x(_?[0-9a-fA-F])+\\b" # hex | ||
|
||
- constant.string: | ||
start: "\"" | ||
end: "(\"|$)" | ||
skip: "\\\\." | ||
rules: | ||
- constant.specialChar: "\\\\." | ||
|
||
- constant.string: | ||
start: "'" | ||
end: "('|$)" | ||
skip: "\\\\." | ||
rules: | ||
- constant.specialChar: "\\\\." | ||
|
||
- comment: | ||
start: "\\#" | ||
end: "$" | ||
rules: | ||
- todo: "(TODO|FIXME|HACK|BUG|NOTE|FAQ|MNEMONIC|REQ|RFE|IDEA|PORT|\\?\\?\\?|!!!|GLOSS|SEE|TODOC|STAT|RVD|CRED):?" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried looking at this file but I do not think these types are in Bend:
https://github.com/HigherOrderCO/Bend/blob/main/docs/builtins.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry added -type thing, but can we keep true false? because people do use true false in bend by declaring this on their side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I did not mean removing the pattern matching
true
andfalse
but I realized there isnull
andthis
in the comment even though those are not highlighted. The types at the link I referenced can still be higlighted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, fixed that because the
null
andthis
isn't a actual type in bend afaik