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

Added DenizenScript Language Support #5773

Merged
merged 5 commits into from
Feb 17, 2022
Merged
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
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@
[submodule "vendor/grammars/data-weave-tmLanguage"]
path = vendor/grammars/data-weave-tmLanguage
url = https://github.com/mulesoft-labs/data-weave-tmLanguage
[submodule "vendor/grammars/denizenscript-grammar"]
path = vendor/grammars/denizenscript-grammar
url = https://github.com/BreadcrumbIsTaken/denizenscript-grammar.git
[submodule "vendor/grammars/desktop.tmbundle"]
path = vendor/grammars/desktop.tmbundle
url = https://github.com/Mailaender/desktop.tmbundle.git
Expand Down Expand Up @@ -554,6 +557,9 @@
[submodule "vendor/grammars/language-cwl"]
path = vendor/grammars/language-cwl
url = https://github.com/manabuishii/language-cwl
[submodule "vendor/grammars/language-debian"]
path = vendor/grammars/language-debian
url = https://github.com/tsbarnes/language-debian.git
[submodule "vendor/grammars/language-dircolors"]
path = vendor/grammars/language-dircolors
url = https://github.com/jolkdarr/language-dircolors
Expand Down
5 changes: 5 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ vendor/grammars/dart-syntax-highlight:
- source.dart
vendor/grammars/data-weave-tmLanguage:
- source.data-weave
vendor/grammars/denizenscript-grammar:
- source.denizenscript
vendor/grammars/desktop.tmbundle:
- source.desktop
vendor/grammars/diff.tmbundle:
Expand Down Expand Up @@ -453,6 +455,9 @@ vendor/grammars/language-css:
- source.css
vendor/grammars/language-cwl:
- source.cwl
vendor/grammars/language-debian:
- source.deb-control
- source.debian.makefile
vendor/grammars/language-dircolors:
- source.dircolors
vendor/grammars/language-emacs-lisp:
Expand Down
18 changes: 18 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,24 @@ DataWeave:
ace_mode: text
tm_scope: source.data-weave
language_id: 974514097
Debian Package Control File:
type: data
color: "#D70751"
extensions:
- ".dsc"
tm_scope: source.deb-control
ace_mode: text
language_id: 527438264
DenizenScript:
type: programming
color: "#FBEE96"
ace_mode: yaml
codemirror_mode: yaml
codemirror_mime_type: text/x-yaml
extensions:
- ".dsc"
BreadcrumbIsTaken marked this conversation as resolved.
Show resolved Hide resolved
tm_scope: source.denizenscript
language_id: 435000929
Dhall:
type: programming
color: "#dfafff"
Expand Down
17 changes: 17 additions & 0 deletions samples/Debian Package Control File/example1.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Format: 1.0
Source: libdependable
Binary: libdependable, libdependable-dev
Architecture: any
Version: 1:2.3-4
Maintainer: Test Maintainer <test.maintainer@example.com>
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 9)
Package-List:
libdependable deb misc optional arch=any
libdependable-dev deb misc optional arch=any
Checksums-Sha1:
5345aec6bad1d7e03f3afaae5cd6d00bc7df5cfe 786 libdependable_2.3-4.tar.gz
Checksums-Sha256:
8b770fde1df196e6b0b222f42f5e698ca1fd220a8cc1274ce8b9b63bdada9137 786 libdependable_2.3-4.tar.gz
Files:
320a8fe6cf08e6d6bd030182e47effa5 786 libdependable_2.3-4.tar.gz
23 changes: 23 additions & 0 deletions samples/Debian Package Control File/example2.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Source: e2fsprogs
Section: admin
Priority: required
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
Build-Depends: texi2html (>= 1.76), gettext:any, texinfo, pkg-config, gcc-multilib [mips mipsel], debhelper (>= 7.0), libblkid-dev (>= 2.16), uuid-dev (>= 2.16), m4
Standards-Version: 3.9.2
Homepage: http://e2fsprogs.sourceforge.net

Package: e2fsprogs
Essential: yes
Pre-Depends: ${shlibs:Depends}, ${misc:Depends}, util-linux (>= 2.15~rc1-1)
Suggests: gpart, parted, e2fsck-static
Conflicts: dump (<< 0.4b4-4), quota (<< 1.55-8.1), initscripts (<< 2.85-4), sysvinit (<< 2.85-4)
Replaces: hurd (<= 20040301-1), libblkid1 (<< 1.38+1.39-WIP-2005.12.10-2), libuuid1 (<< 1.38+1.39-WIP-2005.12.10-2)
Architecture: any
Description: ext2/ext3/ext4 file system utilities
The ext2, ext3 and ext4 file systems are successors of the original ext
("extended") file system. They are the main file system types used for
hard disks on Debian and other Linux systems.
.
This package contains programs for creating, checking, and maintaining
ext2/3/4-based file systems.
83 changes: 83 additions & 0 deletions samples/DenizenScript/sample1.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Main faction task.
faction:
type: task
script:
- narrate Claim! format:faction_action_format
edit:
- narrate Edit! format:faction_action_format
invite:
- narrate Invite! format:faction_action_format
settings:
- narrate Settings! format:faction_action_format
transfer_ownership:
- if !<player.has_flag[waiting_for_owner_transfer_request_acceptance]>:
- inventory open d:faction_action_danger_zone_transfer_ownership_player_list_inventory
- else:
- narrate "You are still waiting for <player.flag[waiting_for_owner_transfer_request_acceptance].name> to accept the ownership!" format:faction_action_format
create:
- if !<server.has_flag[factions]>:
- flag server factions:<map[]>
- flag server "factions.all claims:<list[]>"

- flag server FACTION_IDS:++

- define FACTION_UUID faction_<server.flag[FACTION_IDS]>

- flag player FACTION:<[FACTION_UUID]>

- definemap default_faction_data:
owner: <player.uuid>
members: <list[<player.uuid>]>
name: <player.name>'s Faction
settings:
permissions:
# This is just place holder stuff ;0
- OwnersGetAllPerms
- MembersGetBasicPerms
- OutsidersDoNotGetPerms
color: <white>
display name: <white><player.name>'s Faction
rivalries: <list[]>
allies: <list[]>
power: 100
claims: <list[<player.location.chunk.cuboid>]>

- note <player.location.chunk.cuboid> as:faction_cuboid_<[FACTION_UUID]>
- flag server "factions.all claims:->:<player.location.chunk.cuboid>"
- flag server factions.<[FACTION_UUID]>:<[default_faction_data]>

- narrate "<green>Faction created! Check it out by using '/faction'!" format:faction_action_format
delete:
- define FACTION_UUID <player.flag[FACTION]>

- define members <[FACTION_UUID].proc[get_members]>
- foreach <[members]> as:m:
- flag <player[<[m]>]> faction:!

- foreach <proc[get_all_claims]> as:cl:
- flag server "factions.all claims:<-:<[cl]>"

- flag server factions:<-:<[FACTION_UUID]>

- narrate "<&[success]>Successfully deleted the faction!" format:faction_action_format
leave:
- define faction <player.flag[faction]>
- if <player.uuid> == <[faction].proc[get_owner]>:
- narrate "Sorry, but you are going to have to tranfer ownership of your faction before you can leave it. You can do so in the <red>Danger Zone<reset> section of the Faction Action Inventory. (<bold>/f<reset>)" format:faction_action_format
- stop
- if <[faction].proc[get_members]> == <list[<player.uuid>]>:
- narrate "You have successfully left the faction." format:faction_action_format
- inject faction.delete
wipe:
- foreach <server.offline_players.include[<server.online_players>]> as:p:
- if <[p].has_flag[FACTION]>:
- flag <[p]> FACTION:!
- foreach <proc[get_factions]> as:i:
- flag server factions:<-:<[i]>
- flag server "factions:<-:all claims"
- flag server factions:!
- foreach <server.notes[cuboids]> as:n:
- if <[n].advanced_matches_text[*faction_cuboid_*]>:
- note remove as:<[n].note_name>
- flag server FACTION_IDS:-1
- narrate Wiped. format:faction_action_format
77 changes: 77 additions & 0 deletions samples/DenizenScript/sample2.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
player_chooses_new_owner_of_faction:
type: world
events:
on player clicks item in faction_action_danger_zone_transfer_ownership_player_list_inventory:
- define new_owner <context.item.flag[player_id]>

- define faction <player.proc[get_player_faction]>

- define faction_owner <player[<proc[get_owner].context[<[faction]>]>]>

- if !<player.has_flag[has_ownership_offer]>:
- if <[new_owner].has_flag[faction]>:
- if <[new_owner].uuid> == <[faction_owner].uuid>:
- narrate "<&color[#1569EA]>You can't transfer ownership to yourself! You are already the owner." format:faction_action_format
- inventory close
- flag player waiting_for_owner_transfer_request_acceptance:<[new_owner]> expire:10m
- inventory close
- else:
- flag player waiting_for_owner_transfer_request_acceptance:<[new_owner]> expire:10m
- inventory close

- flag <[new_owner]> has_ownership_offer:<[faction]> expire:10m
- runlater out_of_time_for_transfer delay:5s def.new_owner:<[new_owner]>
- narrate targets:<[new_owner]> "<green><player.name>, wants you to become the new owner of their faction<reset>, <[faction].proc[get_display_name]>. <green>To accept, please issue the command<reset>: <yellow>accept<reset>. <green>To deny, please issue the command<reset>: <yellow>deny <green>or, do nothing. This request will expire in 10 minutes." format:faction_action_format
- else:
- narrate "<[new_owner].name> already has a valid offer. Please try again soon." format:faction_action_format

player_accepts_or_denies_offer_to_be_new_owner:
type: world
events:
on player chats flagged:has_ownership_offer:
- define old_owner <player[<player.flag[has_ownership_offer].proc[get_owner]>]>
- define faction <player.flag[has_ownership_offer]>
- if <context.message.to_lowercase> == accept:
- determine passively cancelled

# Removes both the old owner and new owner from their factions to avoid any errors.
- if <[old_owner].has_flag[faction]>:
- flag server factions.<[old_owner].flag[faction]>.members:<-:<[old_owner].uuid>
- flag <[old_owner]> faction:!
- if <player.has_flag[faction]>:
- flag server factions.<player.flag[faction]>.members:<-:<player.uuid>
- flag player faction:!

- flag server factions.<[faction]>.owner:<player.uuid>
- flag server factions.<[faction]>.members:->:<player.uuid>
- flag player FACTION:<[faction]>

# Re-adds the owner to the faction.
- flag server factions.<[faction]>.members:->:<[old_owner].uuid>
- flag <[old_owner]> faction:<[faction]>

- flag <player> has_ownership_offer:!
- flag <[old_owner]> waiting_for_owner_transfer_request_acceptance:!

- narrate "You are now the owner of <player.flag[has_ownership_offer].proc[get_display_name]>!" format:faction_action_format
- narrate "<player.name> has accepted the offer to become owner! You are now no longer the owner of <[faction].proc[get_display_name]>, but are now a regular member." targets:<[old_owner]> format:faction_action_format

- else if <context.message.to_lowercase> == deny:
- determine passively cancelled

- flag <player> has_ownership_offer:!
- flag <[old_owner]> waiting_for_owner_transfer_request_acceptance:!

- narrate "You have denyed the offer." format:faction_action_format
- narrate "<player.name> <red>has declined your offer to become owner of your faction." targets:<[old_owner]> format:faction_action_format
- else:
- determine cancelled

out_of_time_for_transfer:
type: task
definitions: new_owner
script:
- if <player.has_flag[has_ownership_offer]>:
- narrate "Sorry, the ownership offer has expired." targets:<[new_owner]> format:faction_action_format
- else:
- stop
2 changes: 2 additions & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Dafny:** [DafnyVSCode/Dafny-VSCode](https://github.com/DafnyVSCode/Dafny-VSCode)
- **Dart:** [dart-lang/dart-syntax-highlight](https://github.com/dart-lang/dart-syntax-highlight)
- **DataWeave:** [mulesoft-labs/data-weave-tmLanguage](https://github.com/mulesoft-labs/data-weave-tmLanguage)
- **Debian Package Control File:** [tsbarnes/language-debian](https://github.com/tsbarnes/language-debian)
- **DenizenScript:** [BreadcrumbIsTaken/denizenscript-grammar](https://github.com/BreadcrumbIsTaken/denizenscript-grammar)
- **Dhall:** [atom-haskell/language-haskell](https://github.com/atom-haskell/language-haskell)
- **Diff:** [textmate/diff.tmbundle](https://github.com/textmate/diff.tmbundle)
- **Dockerfile:** [asbjornenge/Docker.tmbundle](https://github.com/asbjornenge/Docker.tmbundle)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/denizenscript-grammar
Submodule denizenscript-grammar added at 4f565e
1 change: 1 addition & 0 deletions vendor/grammars/language-debian
Submodule language-debian added at 990d62
46 changes: 46 additions & 0 deletions vendor/licenses/git_submodule/denizenscript-grammar.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: denizenscript-grammar
version: 4f565e54f3bd3a0cc5bc3ddba480be159b7bd473
type: git_submodule
homepage: https://github.com/BreadcrumbIsTaken/denizenscript-grammar.git
license: mit
licenses:
- sources: LICENSE.md
text: |
Copyright (c) 2022 Breadcrumb (https://breadcrumb.fun)

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.
- sources: README.md
text: "<details>\n <summary>MIT License</summary>\n \n Copyright (c) 2022
Breadcrumb (https://breadcrumb.fun)\n \n Permission is hereby granted, free
of charge, to any person obtaining a copy\n of this software and associated
documentation files (the \"Software\"), to deal\n in the Software without restriction,
including without limitation the rights\n to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell\n copies of the Software, and to permit
persons to whom the Software is\n furnished to do so, subject to the following
conditions:\n\n The above copyright notice and this permission notice shall
be included in all\n copies or substantial portions of the Software.\n\n THE
SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR
A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n</details>"
notices: []
30 changes: 30 additions & 0 deletions vendor/licenses/git_submodule/language-debian.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: language-debian
version: 990d62ba9d66d102ba88e18579c8e2106e04aa69
type: git_submodule
homepage: https://github.com/tsbarnes/language-debian.git
license: mit
licenses:
- sources: LICENSE.md
text: |
Copyright (c) 2015 <Your name here>

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: []