On 2/11/08, Gerry F. [email protected] wrote:
Robert K. wrote:
288: {
printk( " no PCI bus?@#!\n");
return NumberOfAdapters;
This has #! looking very uncommentlike. Is #! a token separate from # ?
(Does ruby have tokens at all?)
Well the link that Robert posted was to some C code, so it shouldn’t
be expected to give much insight into Ruby syntax/lexing.
Note that there ARE cases in Ruby where a # does not start a comment,
for example, it is used tor interpolation in string and regular
expression ‘literals’
a = “Foo”
puts “The value of a is #{a}”
“Foo Fighters”.match(/#{a)/)
And of course a # inside of string or regexp doesn’t start a comment
even if it isn’t triggering interpolation.
–
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
On 2/11/08, Tim H. [email protected] wrote:
Since it is running, somehow the ruby interpreter has been started and
given a file containing text that may or may not actually be Ruby code.
This could happen if you started ruby by explicitly executing the “ruby”
command, or if you’re running on Windows where there is no shell to do
shebang interpreting for you.
That bit of code inspects the shebang line and, if the word “ruby”
doesn’t appear on the line, it tries to execute what it assumes is a
program.
Actually what that code does is:
If the first line is a shebang
if it doesn’t contain ‘ruby’ somewhere
extract the path which it seems to be wanting to run
produce a fatal error
else
extract any arguments for the ruby command
continue to process.
end
end
So it is trying to avoid accidentially running, say a bash or perl
script using the ruby interpreter.
–
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/