This file contains hidden or 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
Red [ | |
Title: "Word finder" | |
Purpose: {Find occurrences of words in the source files | |
of the Red toolchain and display them} | |
Author: "Rudolf W. MEIJER" | |
File: %word-finder.red | |
Needs: 'View | |
Rights: "Copyright (c) 2019 Rudolf W. MEIJER" | |
History: [ | |
[0.0 23-Jan-2019 {Start of project}] |
This file contains hidden or 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
Red [ | |
Title: "Red program structure checker" | |
Purpose: {Check if brackets/parens are matching in a Red file | |
and give errors with indication of line number} | |
Author: "Rudolf W. MEIJER" | |
File: %check-structure.red | |
History: [ | |
[0.0 04-Jan-2019 {Start of project}] | |
[0.5 05-Jan-2019 {First working version}] | |
[0.6 01-Feb-2019 {Added %" "}] |
This file contains hidden or 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
Red [ | |
Purpose: "PoC script for checking if brackets/parens are matching in a Red file" | |
] | |
check-brackets: function [file [file!]][ | |
line: 1 | |
stack: clear [] | |
skip-chars: complement charset "[]()^/" | |
parse read file [ |
This file contains hidden or 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
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 2018-12-11 | |
Improvements: @9214 | |
] | |
thru: make op! func [a b /local inc op cmp][ | |
inc: pick [1% 1] percent? a | |
set [op cmp] reduce pick [[:+ :<][:- :>]] a < b | |
collect [until [keep a b cmp a: a op inc]] | |
] |
This file contains hidden or 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
Red [ | |
Author: "Toomas Vooglaid" | |
Date: "2017-05-07" | |
Changed: "2018-09-08" | |
Purpose: "Print a directory tree" | |
File: "%dir-tree.red" | |
] | |
context [ | |
; Some helpers | |
get-char: func [hex][to-char to-integer hex] |
This file contains hidden or 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
Red [ | |
author: "Nędza Darek" | |
license: "Just point to this repository/gist" | |
content-used: [ | |
examples: http://www.red-by-example.org | |
docs: https://doc.red-lang.org/en/vid.html | |
] | |
bugs-new_features: [ | |
printing: {Print in nice form and divide by words} | |
] |
This file contains hidden or 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
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 2018-08-10 | |
Last: 2018-08-11 | |
Purpose: {Attempt at multi-selection text-list style} | |
] | |
cnt: 0 | |
view [ | |
style multi-selection-text-list: text-list | |
on-create [face/extra: object [key: none selected: none selection: copy [] nums: copy [] layer: none]] |
This file contains hidden or 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
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 2018-08-04 | |
Last: 2019-04-19 | |
Purpose: "Concatenating any-strings with provided delimiter" | |
Licence: "MIT" | |
] | |
concat: function [ | |
arg1 [any-string! any-block!] | |
arg2 [series! any-word! any-path! char!] |
This file contains hidden or 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
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 2018-08-04 | |
Last: 2018-08-04 | |
Purpose: "Adding wildcards to `find`" | |
] | |
find': function [series 'value /part length /only /case /same /any /with wild /skip size /last /reverse /tail /match][ | |
system/words/case [ | |
any [ | |
out: none |
This file contains hidden or 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
Red [] | |
export: func [ | |
"Export a value to the global context" | |
'word [set-word!] | |
value | |
/to ctx [any-word! any-object! function!] | |
] [ | |
set word :value | |
unless :ctx [ctx: system/words] |