Forums

Something missing?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Something missing?

Postby gogobyte » Sun Sep 28, 2008 3:34 pm

Hello Chuck,
why I can't see the following words in KeywordSpecs.cobra: 'abstract', 'and' (from "and ensure"), 'assembly', 'ct_trace', 'fake', 'internal', 'new', 'nonvirtual', 'or' (from "or require"), 'partial', 'private', 'protected', 'public' and numeric types like 'int32', 'uint16' ... ?
gogobyte
 
Posts: 13

Re: Something missing?

Postby Charles » Mon Sep 29, 2008 2:39 pm

Some words like "protected" and "partial" are simply done through string matches. In other words, those words come in as identifiers and the parser checks for them. However, I'm planning on changing them to real keywords.

"assembly" will remain a virtual keyword. It's only used for declaring assembly level attributes and its a common enough name for parameters and local vars when working with instances of Assembly.

The integer types with explicit sizes are identified via a regex such as int[0-9]+ which is then checked for a valid value of (8, 16, 32, 64). Maybe those should be added, but marked as "documentation only" so the tokenizer doesn't pick them up?

I've added a group+explanation for "and" and "or" with respect to contracts.

Finally, I plan to enhance CommandLine.cobra to spit this information out via a -keywords argument, but I don't want to make that enhancement until I've applied an outstanding patch to CommandLine.cobra.

Thanks for the questions,
-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 104 guests