Add a command line parsing procedure

This commit is contained in:
2025-05-31 11:28:24 +02:00
parent 6e415e474f
commit dad1d11345
10 changed files with 126 additions and 7 deletions

View File

@ -44,10 +44,12 @@ end
.partition { |f| f.end_with? '.elna' }
File.open t.name, 'w' do |output|
puts
puts(compiler * ' ')
compiler_command = compiler + sources
Open3.popen2(*compiler) do |cl_in, cl_out|
puts
puts(compiler_command * ' ')
Open3.popen2(*compiler_command) do |cl_in, cl_out|
cl_in.write File.read(*sources)
cl_in.close
@ -104,7 +106,7 @@ task :backport do
source
.gsub(/^(var|type|const|begin)/) { |match| match.upcase }
.gsub(/^[[:alnum:]]* ?module/) { |match| match.upcase }
.gsub(/\b(record|nil|or)\b/) { |match| match.upcase }
.gsub(/\b(record|nil|or|false|true)\b/) { |match| match.upcase }
.gsub(/proc\(/, 'PROCEDURE(')
.gsub(/ & /, ' AND ')
.gsub(/ -> /, ': ')