Ticket #1760: opsc_version_fix.patch
| File opsc_version_fix.patch, 1.6 KB (added by cotto, 3 years ago) |
|---|
-
compilers/opsc/ops2c.nqp
75 75 -h --help print this usage information 76 76 -n --no-lines do not print #line directives in generated C code (line numbers are not currently supported) 77 77 78 #debugging options:78 debugging options: 79 79 -g --debug perform all processing but do not write to any files 80 80 "); 81 81 pir::exit(0); -
compilers/opsc/src/Ops/File.pm
311 311 'VERSION'; 312 312 } 313 313 314 my $version := pir::chopn__ssi(slurp($version_filename), 1); 314 grammar VERSION { 315 rule TOP { <version> } 316 rule version { $<major>=(\d+) '.' $<minor>=(\d+) '.' $<patch>=(\d+) } 317 } 318 319 my $version := slurp($version_filename); 320 my $version_match := VERSION.parse($version); 315 321 #say("# $version"); 316 my @bits := split('.', $version); 317 self<version_major> := @bits[0]; 318 self<version_minor> := @bits[1]; 319 self<version_patch> := @bits[2]; 320 self<version> := @bits; 322 self<version_major> := +$version_match<version><major>; 323 self<version_minor> := +$version_match<version><minor>; 324 self<version_patch> := +$version_match<version><patch>; 325 self<version> := [ 326 +self<version_major>, 327 +self<version_minor>, 328 +self<version_match>, 329 ]; 321 330 } 322 331 323 332 # Local Variables:
