Yes, I'm using Emacs, so it may be an option to customize
chpl-mode.el according to my preference (though I don't know
the syntax of Emacs lisp very well...)
Just inserting "label" into the following part of
$CHPL_HOME/highlight/emacs/chpl-mode.el,
(c-lang-defconst c-simple-stmt-kwds
"Statement keywords followed by an expression or nothing."
chpl '("break" "continue" "label" "return" "yield"))
the code now highlights "label" nicely :)
Best regards,
-- Takeshi
2017-05-27 8:21 GMT+09:00 Brad Chamberlain <[email protected]>:
>
> Takeshi --
>
> If you're an emacs user like I am, I'm noting that it's not doing a good job
> of highlighting 'label' in a way that might clue a user into realizing that
> it was reserved... :'(
>
> vim seems to be doing a better job with 'label' (but is clearly a far
> inferior editor, so that's not a real solution... :)
>
> -Brad
>
>
>
> On Fri, 26 May 2017, Takeshi Yamamoto wrote:
>
>> Dear Nikhil,
>>
>> I see, this is a keyword for "label"ing for-loops etc... XD
>>
>> I will try to search the Language Spec PDF from the next time :-)
>>
>> Thanks very much,
>> -- Takeshi
>>
>> 2017-05-27 8:00 GMT+09:00 Nikhil Padmanabhan
>> <[email protected]>:
>>>
>>> Dear Takeshi,
>>>
>>> "label" is a Chapel keyword (for loops)....
>>>
>>> See the Chapel language spec here :
>>> http://chapel.cray.com/docs/latest/_downloads/chapelLanguageSpec.pdf
>>>
>>> Sec 6.4.2 and Sec 11.10 in particular.....
>>>
>>> Cheers,
>>> -- Nikhil
>>>
>>>
>>> ---------------------------------
>>> Nikhil Padmanabhan
>>> [email protected]
>>>
>>> On Fri, May 26, 2017 at 6:46 PM, Takeshi Yamamoto
>>> <[email protected]>
>>> wrote:
>>>>
>>>>
>>>> Hello,
>>>>
>>>> In the following code, I am trying to print a simple string
>>>> and the value of x:
>>>>
>>>> ---- test.chpl ---
>>>>
>>>> // proc foo( label, x ) {
>>>> // writeln( label, " : ", x );
>>>> // }
>>>>
>>>> proc Foo( Label, x ) {
>>>> writeln( Label, " : ", x );
>>>> }
>>>>
>>>> proc bar( msg, x ) {
>>>> writeln( msg, " : ", x );
>>>> }
>>>>
>>>> var x = 1.23;
>>>>
>>>> // foo( "foo", x );
>>>> Foo( "Foo", x );
>>>> bar( "bar", x );
>>>>
>>>> --------------------------
>>>>
>>>> The only difference among foo(), Foo(), and bar() is
>>>> the name of the first formal argument (i.e., "label" vs "Label"
>>>> vs "msg").
>>>>
>>>> The functions Foo() and bar() work as expected,
>>>> while if I uncomment the definition of foo(),
>>>> the following error occurs:
>>>>
>>>> test.chpl:2: syntax error: near 'label'
>>>>
>>>> where line 2 refers to
>>>>
>>>> proc foo( label, x ) {
>>>>
>>>> So it seems that the variable name "label" has some problem,
>>>> but I cannot find a keyword such as "label" from the online
>>>> manual.
>>>>
>>>> Is there something strange with my code above, or am I
>>>> missing something...?
>>>>
>>>> With best regards,
>>>> Takeshi Yamamoto
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Chapel-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/chapel-users
>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Chapel-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/chapel-users
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users