mirror of
https://github.com/mgcaret/of816.git
synced 2024-12-27 04:29:32 +00:00
update utils to support indexing of headerless words
This commit is contained in:
parent
5433d59009
commit
b15d48228e
@ -6,8 +6,9 @@ def usage
|
|||||||
Usage: #{$0} index-file|-
|
Usage: #{$0} index-file|-
|
||||||
|
|
||||||
Reads index file (- for stdin) and produces a test coverage
|
Reads index file (- for stdin) and produces a test coverage
|
||||||
report. The index file must have been merged with test
|
report for non-headerless words. The index file must have
|
||||||
coverage data or all words will be reporteed as uncovered.
|
been merged with test coverage data or all words will be
|
||||||
|
reported as uncovered.
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
@ -25,6 +26,7 @@ covered = []
|
|||||||
uncovered = []
|
uncovered = []
|
||||||
|
|
||||||
index.each_pair do |name, props|
|
index.each_pair do |name, props|
|
||||||
|
next if props['headerless']
|
||||||
if props["tests"] && props["tests"] > 0
|
if props["tests"] && props["tests"] > 0
|
||||||
covered << name
|
covered << name
|
||||||
else
|
else
|
||||||
|
13
utils/fs2asm.rb
Normal file → Executable file
13
utils/fs2asm.rb
Normal file → Executable file
@ -55,7 +55,9 @@
|
|||||||
#
|
#
|
||||||
# Words may be changed to headerless and back to normal with HEADERS and HEADERLESS.
|
# Words may be changed to headerless and back to normal with HEADERS and HEADERLESS.
|
||||||
|
|
||||||
# Unsupported features:
|
# Unsupported items:
|
||||||
|
#
|
||||||
|
# Setting flags on words.
|
||||||
#
|
#
|
||||||
# RECURSE $HEX( TO and END-CODE
|
# RECURSE $HEX( TO and END-CODE
|
||||||
# quotations: [: and ;]
|
# quotations: [: and ;]
|
||||||
@ -476,6 +478,14 @@ def f_literal
|
|||||||
emit_line('', 'ONLIT', @stack.pop)
|
emit_line('', 'ONLIT', @stack.pop)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def f_2literal
|
||||||
|
abort('LITERAL outside of definition') unless @in_colon
|
||||||
|
n2 = @stack.pop
|
||||||
|
n1 = @stack.pop
|
||||||
|
emit_line('', 'ONLIT', n1)
|
||||||
|
emit_line('', 'ONLIT', n2)
|
||||||
|
end
|
||||||
|
|
||||||
def f_postpone
|
def f_postpone
|
||||||
abort('POSTPONE outside of definition') unless @in_colon
|
abort('POSTPONE outside of definition') unless @in_colon
|
||||||
w = parse_word.upcase
|
w = parse_word.upcase
|
||||||
@ -600,6 +610,7 @@ end
|
|||||||
'CONTROL' => method(:f_control),
|
'CONTROL' => method(:f_control),
|
||||||
'[COMPILE]' => method(:f_ccompile),
|
'[COMPILE]' => method(:f_ccompile),
|
||||||
'LITERAL' => method(:f_literal),
|
'LITERAL' => method(:f_literal),
|
||||||
|
'2LITERAL' => method(:f_2literal),
|
||||||
'POSTPONE' => method(:f_postpone),
|
'POSTPONE' => method(:f_postpone),
|
||||||
'COMPILE' => method(:f_compile),
|
'COMPILE' => method(:f_compile),
|
||||||
'H#' => method(:f_hnum),
|
'H#' => method(:f_hnum),
|
||||||
|
@ -34,15 +34,15 @@ input.lines.each do |line|
|
|||||||
# nothing
|
# nothing
|
||||||
when /^\s*;\s+H:\s*(.+)/
|
when /^\s*;\s+H:\s*(.+)/
|
||||||
help << $1
|
help << $1
|
||||||
when /^\s*dword(q?)\s+(.+)/
|
when /^\s*([dh])word(q?)\s+(.+)/
|
||||||
label, name, flags = CSV.parse_line($2)
|
label, name, flags = CSV.parse_line($3)
|
||||||
name.upcase!
|
name.upcase!
|
||||||
name.tr!("'", '"') if $1 == 'q'
|
name.tr!("'", '"') if $2 == 'q'
|
||||||
output[name] ||= {"label" => label}
|
output[name] ||= {'label' => label, 'headerless' => ($1 == 'h')}
|
||||||
output[name].merge!({"help" => help}) unless help.empty?
|
output[name].merge!({'help' => help}) unless help.empty?
|
||||||
if flags
|
if flags
|
||||||
fl = flags.split(/[|\+]/)
|
fl = flags.split(/[|\+]/)
|
||||||
output[name].merge!({"flags" => fl}) unless fl.empty?
|
output[name].merge!({'flags' => fl}) unless fl.empty?
|
||||||
end
|
end
|
||||||
output[name].merge!({"tests" => coverage[name.downcase]}) if coverage[name.downcase]
|
output[name].merge!({"tests" => coverage[name.downcase]}) if coverage[name.downcase]
|
||||||
when /^\s*eword/
|
when /^\s*eword/
|
||||||
|
@ -7,7 +7,8 @@ def usage
|
|||||||
Usage: #{$0} index-file|- [dictionary-title]
|
Usage: #{$0} index-file|- [dictionary-title]
|
||||||
|
|
||||||
reads index file (- for stdin) and produces markdown-
|
reads index file (- for stdin) and produces markdown-
|
||||||
formatted output for documentation purposes.
|
formatted output documenting non-headerless words for the
|
||||||
|
indexed dictionary.
|
||||||
|
|
||||||
if dictionary-title is specified, it is used as the top
|
if dictionary-title is specified, it is used as the top
|
||||||
level heading instead of the file name.
|
level heading instead of the file name.
|
||||||
@ -33,6 +34,7 @@ puts
|
|||||||
|
|
||||||
index.keys.sort.each do |word|
|
index.keys.sort.each do |word|
|
||||||
word_info = index[word]
|
word_info = index[word]
|
||||||
|
next if word_info['headerless']
|
||||||
cword = word.gsub(/^(#+)$/) { "\\#{$1}" } # let '#' display properly
|
cword = word.gsub(/^(#+)$/) { "\\#{$1}" } # let '#' display properly
|
||||||
cword.gsub!(/^([<>])/) { "\\#{$1}" }
|
cword.gsub!(/^([<>])/) { "\\#{$1}" }
|
||||||
puts "## #{cword}"
|
puts "## #{cword}"
|
||||||
|
Loading…
Reference in New Issue
Block a user