Skip to content

Commit

Permalink
Minor change to parse-compiler to minimize confusion for new users
Browse files Browse the repository at this point in the history
  • Loading branch information
giesse committed Apr 6, 2019
1 parent 667cb74 commit ebefe83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
13 changes: 5 additions & 8 deletions make.red
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,16 @@ Red [
}
]

unless exists? %parse-compiler.red [
print "Downloading pre-built version of parse-compiler.red for bootstrap..."
write %parse-compiler.red read https://github.com/giesse/red-topaz-parse/releases/download/bootstrap.1/parse-compiler.red
unless exists? %compiled-rules.red [
print "Downloading pre-built version of compiled-rules.red for bootstrap..."
write %compiled-rules.red read https://github.com/giesse/red-topaz-parse/releases/download/bootstrap.2/compiled-rules.red
]

do %parse-compiler.red
do %parse-parse.red

template: load %parse-compiler-template.red

print "Building new parse-compiler.red..."
print "Building new compiled-rules.red..."
compiled-rules: parse-compiler/compile-rules in parse-parse 'alternatives
change find/tail select template 'context [compiled-rules:] compiled-rules
write %parse-compiler.red mold/only template
write %compiled-rules.red mold/all compiled-rules

print "All done!"
5 changes: 4 additions & 1 deletion parse-compiler-template.red → parse-compiler.red
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ Red [
do %ast-tools.red

parse-compiler: context [
compiled-rules: []
unless exists? %compiled-rules.red [
do make error! "%compiled-rules.red missing. Please do %make.red first."
]
compiled-rules: do load %compiled-rules.red

compile-rules*: function [result name rules] [
compiled-rules/_collection: compiled-rules/_result: none
Expand Down

0 comments on commit ebefe83

Please sign in to comment.