Skip to content

Commit

Permalink
FIX: additional fix for issue #288 (Formal args of parametrized macro…
Browse files Browse the repository at this point in the history
…s are not constrained to (non key-)words)
  • Loading branch information
dockimbel committed Nov 5, 2012
1 parent 48946a8 commit 733c4f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions red-system/compiler.r
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ system-dialect: make-profilable context [
sym-ctx-table: make hash! 100 ;-- reverse lookup table for contexts
globals: make hash! 40 ;-- list of globally defined symbols from scripts
aliased-types: make hash! 10 ;-- list of aliased type definitions
keywords-list: make block! 20

resolve-alias?: yes ;-- YES: instruct the type resolution function to reduce aliases
decoration: slash ;-- decoration separator for namespaces
Expand Down Expand Up @@ -165,6 +166,9 @@ system-dialect: make-profilable context [
alias [raise-level-error "an alias"] ;-- alias declaration not allowed at this level
]

foreach [word action] keywords [append keywords-list word]
foreach [name spec] functions [append keywords-list name]

calc-line: has [idx head-end prev p header][
header: head pc
idx: (index? pc) - header/1 ;-- calculate real pc position (not counting hidden header)
Expand Down
3 changes: 3 additions & 0 deletions red-system/loader.r
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ loader: make-profilable context [
unless parse args [some word!][
throw-error ["only words can be used as macro parameters:" mold args]
]
unless empty? intersect to block! args compiler/keywords-list [
throw-error ["keywords cannot be used as macro parameters:" mold args]
]
]

check-marker: func [src [string!] /local pos][
Expand Down

0 comments on commit 733c4f5

Please sign in to comment.