Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/liblex/yyless.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include	<u.h>
2
#include	<libc.h>
3
#include	<stdio.h>
4
 
5
extern	char	yytext[];
6
extern	int	yyleng;
7
extern	int	yyprevious;
8
 
9
void	yyunput(int c);
10
 
11
void
12
yyless(int x)
13
{
14
	char *lastch, *ptr;
15
 
16
	lastch = yytext+yyleng;
17
	if(x>=0 && x <= yyleng)
18
		ptr = x + yytext;
19
	else
20
		ptr = (char*)x;
21
	while(lastch > ptr)
22
		yyunput(*--lastch);
23
	*lastch = 0;
24
	if (ptr >yytext)
25
		yyprevious = lastch[-1];
26
	yyleng = ptr-yytext;
27
}