diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-04-29 00:55:20 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-04-29 00:55:20 +0200 |
| commit | 9c66cec171bafaf12713efb78ac6099ef1f23020 (patch) | |
| tree | f54e2c7713d92b2a52372dfbedfe63e6637d8ec1 /Rakefile | |
| parent | 963d32e8d1ab322d77768b5464e7360fd6feb3cd (diff) | |
| download | elna-9c66cec171bafaf12713efb78ac6099ef1f23020.tar.gz | |
Implement if statements
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,5 +1,8 @@ +# frozen_string_literal: true + require 'open3' require 'rake/clean' +require 'term/ansicolor' CLOBBER.include 'build' @@ -10,7 +13,7 @@ QEMU = 'qemu-riscv32' def assemble_stage(output, compiler, source) arguments = [QEMU, '-L', SYSROOT, *compiler] - puts(arguments * ' ') + puts Term::ANSIColor.green(arguments * ' ') puts Open3.popen2(*arguments) do |qemu_in, qemu_out| qemu_in.write File.read(*source) @@ -27,7 +30,7 @@ task default: ['build/stage2b', 'build/stage2b.s', 'boot/stage2.elna'] do |t| cat_arguments = ['cat', source] compiler_arguments = [QEMU, '-L', SYSROOT, exe] - diff_arguments = ['diff', '-Nur', previous_output, '-'] + diff_arguments = ['diff', '-Nur', '--text', previous_output, '-'] Open3.pipeline(cat_arguments, compiler_arguments, diff_arguments) end @@ -70,7 +73,8 @@ task :statistics do word.start_with?('(*') || word.start_with?('*)') || ('A'..'Z').include?(word[0]) || - /^[[:alpha:]][[:digit:]]$/.match(word) + /^[[:alpha:]][[:digit:]]$/.match(word) || + ['end', 'if'].include?(word) end lines = File.read('boot/stage2.elna') |
