Skip to content

Commit

Permalink
fix lex on stdout and a<-b parsing
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R-packages/trunk/Mac-GUI@6432 694ef91d-65df-0310-b7bb-92e67a308ead
  • Loading branch information
s-u committed Jan 21, 2013
1 parent cb17ce7 commit d5fd05e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
NEWS for R.app GUI for Mac OS X


Last-update: 2013-01-20 [HJBB]
* Avoid superfluous lex output on stdout
* Treat a<-1 as a <- 1 and not a < -1

Last-update: 2012-12-28 [BDR]
* New targets Lion and Lion64 for use with Xcode 4.5+
* Use hooks in Rinterface.h where possible
Expand Down
5 changes: 5 additions & 0 deletions RScriptEditorTokens.l
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ size_t yyuoffset, yyuleng;

//keep track of the current utf-8 character (not byte) offset and token length
#define YY_USER_ACTION { yyuoffset += yyuleng; yyuleng = utf8strlen(yytext); }
//ignore the output of unmatched characters
#define ECHO {}
%}
%option noyywrap
%option nounput
Expand Down Expand Up @@ -77,6 +79,9 @@ functions (if|f(or|unction)|while)

{variable}/{fun} { return RPT_OTHER; } /* non-reserved functions */

{variable}/{decl} { BEGIN(varequation); return RPT_VARIABLE; } /* R variables before operator */
<varequation>{decl} { BEGIN(INITIAL); return RPT_OTHER; }

{variable}/{ops} { BEGIN(varequation); return RPT_VARIABLE; } /* R variables before operator */
<varequation>{ops} { BEGIN(INITIAL); return RPT_OTHER; }
{variable} { return RPT_VARIABLE; } /* R variables */
Expand Down

0 comments on commit d5fd05e

Please sign in to comment.