Skip to content

Commit

Permalink
Add Rez (#6524)
Browse files Browse the repository at this point in the history
* Add Rez

* Update heuristics.yml

add one for Rez (could use some more, though)

* Update languages.yml

add color, suggested by @uliwitness in #6524

* Update heuristics.yml

Improved Rez detection from @uliwitness

* Update languages.yml

remove `.rez` extension due to no examples of it being present; resolves review comment

* Update heuristics.yml

backslashes don't need to be escaped, apparently, so stop doubling up on them

* remove too-large Rez samples

* Create rez.tmbundle.dep.yml

I tried rerunning `scripts/grammar`, but it did some other weird stuff, so I had to stash its other changes. It left this behind, though, which is hopefully what was requested in the PR

* Update lib/linguist/heuristics.yml

* Update lib/linguist/heuristics.yml

* Update README.md

* Sort .gitmodules

* Update vendor/licenses/git_submodule/rez.tmbundle.dep.yml

---------

Co-authored-by: Colin Seymour <colin@github.com>
Co-authored-by: Colin Seymour <colin@symr.io>
  • Loading branch information
3 people committed Sep 7, 2023
1 parent ec4435f commit 55cfb49
Show file tree
Hide file tree
Showing 10 changed files with 277 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,9 @@
[submodule "vendor/grammars/rescript-vscode"]
path = vendor/grammars/rescript-vscode
url = https://github.com/rescript-lang/rescript-vscode
[submodule "vendor/grammars/rez.tmbundle"]
path = vendor/grammars/rez.tmbundle
url = https://github.com/textmate/rez.tmbundle.git
[submodule "vendor/grammars/riot-syntax-highlight"]
path = vendor/grammars/riot-syntax-highlight
url = https://github.com/riot/syntax-highlight
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,8 @@ vendor/grammars/razor-plus:
vendor/grammars/rescript-vscode:
- markdown.rescript.codeblock
- source.rescript
vendor/grammars/rez.tmbundle:
- source.rez
vendor/grammars/riot-syntax-highlight:
- text.html.riot
vendor/grammars/ruby-slim.tmbundle:
Expand Down
2 changes: 2 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ disambiguations:
rules:
- language: Rebol
pattern: '(?i:\bRebol\b)'
- language: Rez
pattern: '(#include\s+["<](Types\.r|Carbon\/Carbon\.r)[">])|((resource|data|type)\s+''[A-Za-z0-9]{4}''\s+((\(.*\)\s+){0,1}){)'
- language: R
pattern: '<-|^\s*#'
- extensions: ['.re']
Expand Down
14 changes: 11 additions & 3 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2657,8 +2657,8 @@ HOCON:
extensions:
- ".hocon"
filenames:
- .scalafix.conf
- .scalafmt.conf
- ".scalafix.conf"
- ".scalafmt.conf"
tm_scope: source.hocon
ace_mode: text
language_id: 679725279
Expand Down Expand Up @@ -5912,6 +5912,14 @@ RenderScript:
tm_scope: none
ace_mode: text
language_id: 323
Rez:
type: programming
extensions:
- ".r"
tm_scope: source.rez
ace_mode: text
color: "#FFDAB3"
language_id: 498022874
Rich Text Format:
type: markup
extensions:
Expand Down Expand Up @@ -6845,7 +6853,7 @@ TI Program:
TL-Verilog:
type: programming
extensions:
- ".tlv"
- ".tlv"
tm_scope: source.tlverilog
ace_mode: verilog
color: "#C40023"
Expand Down
119 changes: 119 additions & 0 deletions samples/Rez/Rezilla_DITL.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// ===========================================================================
// Rezilla_DITL.r
// Created: 2004-02-25 10:57:56
// Last modification: 2004-02-25 10:58:34
// Author: Bernard Desgraupes
// e-mail: <bdesgraupes@users.sourceforge.net>
// www: <http://rezilla.sourceforge.net/>
// (c) Copyright: Bernard Desgraupes 2003-2004
// All rights reserved.
// ===========================================================================


//#include "Dialogs.r"
#include <Carbon/Carbon.r>

resource 'DITL' (10000, "Nav Services Open", purgeable) {
{ /* array DITLarray: 2 elements */
/* [1] */
{8, 16, 32, 248},
CheckBox {
enabled,
"VCS aware"
},
/* [2] */
{8, 248, 32, 392},
CheckBox {
enabled,
"Read-only"
}
}
};

resource 'DITL' (10001, "Nav Create NewMap", purgeable) {
{ /* array DITLarray: 3 elements */
/* [1] */
{3, 110, 19, 250},
RadioButton {
enabled,
"in resource fork"
},
/* [2] */
{3, 255, 19, 395},
RadioButton {
enabled,
"in data fork"
},
/* [3] */
{3, 8, 19, 108},
StaticText {
disabled,
"New map"
}
}
};

resource 'DITL' (10002, "Nav Open Map", purgeable) {
{ /* array DITLarray: 5 elements */
/* [1] */
{3, 58, 19, 138},
RadioButton {
enabled,
"any fork"
},
/* [2] */
{3, 158, 19, 278},
RadioButton {
enabled,
"resource fork"
},
/* [3] */
{3, 288, 19, 388},
RadioButton {
enabled,
"data fork"
},
/* [4] */
{23, 58, 39, 158},
CheckBox {
enabled,
"Read Only"
},
/* [5] */
{3, 8, 19, 58},
StaticText {
disabled,
"From:"
}
}
};

resource 'DITL' (10003, "Nav Save Map", purgeable) {
{ /* array DITLarray: 3 elements */
/* [1] */
{3, 58, 19, 158},
RadioButton {
enabled,
"same fork"
},
/* [2] */
{3, 168, 19, 288},
RadioButton {
enabled,
"resource fork"
},
/* [3] */
{3, 298, 19, 398},
RadioButton {
enabled,
"data fork"
},
/* [4] */
{3, 8, 19, 58},
StaticText {
disabled,
"To:"
}
}
};

88 changes: 88 additions & 0 deletions samples/Rez/dialog.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
Copyright 2015 Wolfgang Thaller.
This file is part of Retro68.
Retro68 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Retro68 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Retro68. If not, see <http://www.gnu.org/licenses/>.
*/

#include "Dialogs.r"

resource 'DLOG' (128) {
{ 50, 100, 240, 420 },
dBoxProc,
visible,
noGoAway,
0,
128,
"",
centerMainScreen
};

resource 'DITL' (128) {
{
{ 190-10-20, 320-10-80, 190-10, 320-10 },
Button { enabled, "Quit" };

{ 190-10-20-5, 320-10-80-5, 190-10+5, 320-10+5 },
UserItem { enabled };

{ 10, 10, 30, 310 },
StaticText { enabled, "Static Text Item" };

{ 40, 10, 56, 310 },
EditText { enabled, "Edit Text Item" };

{ 70, 10, 86, 310 },
CheckBox { enabled, "Check Box" };

{ 90, 10, 106, 310 },
RadioButton { enabled, "Radio 1" };

{ 110, 10, 126, 310 },
RadioButton { enabled, "Radio 2" };
}
};

#include "Processes.r"

resource 'SIZE' (-1) {
reserved,
acceptSuspendResumeEvents,
reserved,
canBackground,
doesActivateOnFGSwitch,
backgroundAndForeground,
dontGetFrontClicks,
ignoreChildDiedEvents,
is32BitCompatible,
#ifdef TARGET_API_MAC_CARBON
isHighLevelEventAware,
#else
notHighLevelEventAware,
#endif
onlyLocalHLEvents,
notStationeryAware,
dontUseTextEditServices,
reserved,
reserved,
reserved,
#ifdef TARGET_API_MAC_CARBON
500 * 1024, // Carbon apparently needs additional memory.
500 * 1024
#else
100 * 1024,
100 * 1024
#endif
};
33 changes: 33 additions & 0 deletions samples/Rez/gui_mac.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read a list of people who contributed.
* Do ":help credits" in Vim to see a list of people who contributed.
*/

#ifdef environ_os_mac /* or 1 for Carbon, 0 for non-Carbon */
# include <Carbon/Carbon.r>
#else
# include <SysTypes.r>
# include <Types.r>
#endif
#include "version.h"

/* Used as application version */
resource 'vers' (1) {
VIM_VERSION_MAJOR, VIM_VERSION_BUILD_BCD, VIM_VERSION_RELEASE, VIM_VERSION_PATCHLEVEL,
verUS,
VIM_VERSION_MEDIUM,
VIM_VERSION_LONG_DATE $$date " " $$time ")"
};

/* Used as application group version */
resource 'vers' (2) {
VIM_VERSION_MAJOR, VIM_VERSION_BUILD_BCD, VIM_VERSION_RELEASE, VIM_VERSION_PATCHLEVEL,
verUS,
VIM_VERSION_MEDIUM,
VIM_VERSION_LONG
};

/* TODO: Small About box with compile time */
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Redirect Rules:** [Nixinova/NovaGrammars](https://github.com/Nixinova/NovaGrammars)
- **Regular Expression:** [tree-sitter/tree-sitter-regex](https://github.com/tree-sitter/tree-sitter-regex) 🐌
- **Ren'Py:** [williamd1k0/language-renpy](https://github.com/williamd1k0/language-renpy)
- **Rez:** [textmate/rez.tmbundle](https://github.com/textmate/rez.tmbundle)
- **Rich Text Format:** [nwhetsell/language-rtf](https://github.com/nwhetsell/language-rtf)
- **Ring:** [MahmoudFayed/atom-language-ring](https://github.com/MahmoudFayed/atom-language-ring)
- **Riot:** [riot/syntax-highlight](https://github.com/riot/syntax-highlight)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/rez.tmbundle
Submodule rez.tmbundle added at ad6f93
17 changes: 17 additions & 0 deletions vendor/licenses/git_submodule/rez.tmbundle.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: rez.tmbundle
version: ad6f93f7c882bfc45c208a477c0df23ca47afe72
type: git_submodule
homepage: https://github.com/textmate/rez.tmbundle.git
license: permissive
licenses:
- sources: README.mdown
text: "If not otherwise specified (see below), files in this repository fall under
the following license:\n\n\tPermission to copy, use, modify, sell and distribute
this\n\tsoftware is granted. This software is provided \"as is\" without\n\texpress
or implied warranty, and with no claim as to its\n\tsuitability for any purpose.\n\nAn
exception is made for files in readable text which contain their own license information,
or files where an accompanying file exists (in the same directory) with a “-license”
suffix added to the base-name name of the original file, and an extension of txt,
html, or similar. For example “tidy” is accompanied by “tidy-license.txt”."
notices: []

0 comments on commit 55cfb49

Please sign in to comment.