Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Ruby, what exactly does tLABEL mean?

Tags:

ruby

tlabel

I usually gloss over this error when I get it and just fix whatever syntax error caused it, but out of curiosity, what exactly does tLABEL mean in unexpected tLABEL?

I've tried searching for the answer, but just get a ton of people trying to get help with their errors.

I've also found this definition:

tlabel is a nonwindowed VCL control that displays non editable text on a form. It is defined in the StdCtrls.pas unit.

but I don't think that is a very accessible definition.

like image 504
Arel Avatar asked Jul 08 '13 19:07

Arel


2 Answers

A tLABEL is a 'Label' token. It is often used when specifying a hash in the newer 1.9 format:

{ key: value }

In the example above, key: is internally recognized as a token for a Label. The 1.9+ parser converts this to a symbol, whereas the 1.8 parser did not.

The error you are seeing occurs where the parser finds what it deems to be a Label token where it doesn't expect one.

Also, the reference to the 'tlabel' non-windowed control is very much unrelated - that TLabel class is part of the Visual Component Library used by Delphi, as hinted by the .pas (Pascal) extension.

like image 71
PinnyM Avatar answered Oct 19 '22 20:10

PinnyM


An example of that error is happening because there are spaces between the colons, it should be ActiveRecord::Base instead of ActiveRecord: :Base

like image 45
kobaltz Avatar answered Oct 19 '22 20:10

kobaltz