This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 159598 - Need ability in .nbs to return to previous lexical state
Summary: Need ability in .nbs to return to previous lexical state
Status: NEW
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-04 11:31 UTC by rptmaestro
Modified: 2009-03-25 15:39 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rptmaestro 2009-03-04 11:31:24 UTC
Currently, GLF/Schliemann only allows the .nbs author to transition to a named lexical state, but to facilitate the 
development of syntax definitions for highly context-dependent languages (like XQuery, for example), .nbs syntax 
definition files need to allow transitioning to the _previous_ lexical state when the name of that state may not be 
known.

For example, when I come across a left brace '}' token in an XQuery expression, I may need to simply retain the 
current DEFAULT state or, if the expression was inside an XML element or attribute, I will need to revert to the 
previous XML_ELEMENT or XML_ATTRIBUTE lexical state.

Or, as another example, comments in XQuery can be nested, so if I come across an end comment ":)" token, I will need 
to return the state before the last begin comment "(:" token, which may be the DEFAULT state or the IN_COMMENT state.

Currently, the only way I have found to correctly handle cases such as these is to use the language embedding feature 
which, to my mind, is less than ideal, as XQuery really has no language embedding.