Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OP-TEE
busybox
提交
dabbeeb7
B
busybox
项目概览
OP-TEE
/
busybox
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
busybox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
dabbeeb7
编写于
7月 14, 2021
作者:
D
Denys Vlasenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
awk: whitespace and debugging tweaks
Signed-off-by:
N
Denys Vlasenko
<
vda.linux@googlemail.com
>
上级
95fffd8a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
66 addition
and
67 deletion
+66
-67
editors/awk.c
editors/awk.c
+66
-67
未找到文件。
editors/awk.c
浏览文件 @
dabbeeb7
...
...
@@ -199,77 +199,78 @@ typedef struct tsplitter_s {
/* simple token classes */
/* order and hex values are very important!!! See next_token() */
#define
TC_LPAREN (1 << 0)
/* ( */
#define
TC_RPAREN (1 << 1)
/* ) */
#define
TC_REGEXP (1 << 2)
/* /.../ */
#define
TC_OUTRDR (1 << 3)
/* | > >> */
#define
TC_UOPPOST (1 << 4)
/* unary postfix operator ++ -- */
#define
TC_UOPPRE1 (1 << 5)
/* unary prefix operator ++ -- $ */
#define
TC_BINOPX (1 << 6)
/* two-opnd operator */
#define
TC_IN (1 << 7)
/* 'in' */
#define
TC_COMMA (1 << 8)
/* , */
#define
TC_PIPE (1 << 9)
/* input redirection pipe | */
#define
TC_UOPPRE2 (1 << 10)
/* unary prefix operator + - ! */
#define
TC_ARRTERM (1 << 11)
/* ] */
#define
TC_LBRACE (1 << 12)
/* { */
#define
TC_RBRACE (1 << 13)
/* } */
#define
TC_SEMICOL (1 << 14)
/* ; */
#define
TC_NEWLINE
(1 << 15)
#define
TC_STATX (1 << 16)
/* ctl statement (for, next...) */
#define
TC_WHILE (1 << 17)
/* 'while' */
#define
TC_ELSE (1 << 18)
/* 'else' */
#define
TC_BUILTIN
(1 << 19)
#define
TC_LPAREN (1 << 0)
/* ( */
#define
TC_RPAREN (1 << 1)
/* ) */
#define
TC_REGEXP (1 << 2)
/* /.../ */
#define
TC_OUTRDR (1 << 3)
/* | > >> */
#define
TC_UOPPOST (1 << 4)
/* unary postfix operator ++ -- */
#define
TC_UOPPRE1 (1 << 5)
/* unary prefix operator ++ -- $ */
#define
TC_BINOPX (1 << 6)
/* two-opnd operator */
#define
TC_IN (1 << 7)
/* 'in' */
#define
TC_COMMA (1 << 8)
/* , */
#define
TC_PIPE (1 << 9)
/* input redirection pipe | */
#define
TC_UOPPRE2 (1 << 10)
/* unary prefix operator + - ! */
#define
TC_ARRTERM (1 << 11)
/* ] */
#define
TC_LBRACE (1 << 12)
/* { */
#define
TC_RBRACE (1 << 13)
/* } */
#define
TC_SEMICOL (1 << 14)
/* ; */
#define
TC_NEWLINE
(1 << 15)
#define
TC_STATX (1 << 16)
/* ctl statement (for, next...) */
#define
TC_WHILE (1 << 17)
/* 'while' */
#define
TC_ELSE (1 << 18)
/* 'else' */
#define
TC_BUILTIN
(1 << 19)
/* This costs ~50 bytes of code.
* A separate class to support deprecated "length" form. If we don't need that
* (i.e. if we demand that only "length()" with () is valid), then TC_LENGTH
* can be merged with TC_BUILTIN:
*/
#define
TC_LENGTH (1 << 20)
/* 'length' */
#define
TC_GETLINE (1 << 21)
/* 'getline' */
#define
TC_FUNCDECL (1 << 22)
/* 'function' 'func' */
#define
TC_BEGIN (1 << 23)
/* 'BEGIN' */
#define
TC_END (1 << 24)
/* 'END' */
#define
TC_EOF
(1 << 25)
#define
TC_VARIABLE (1 << 26)
/* name */
#define
TC_ARRAY (1 << 27)
/* name[ */
#define
TC_FUNCTION (1 << 28)
/* name( */
#define
TC_STRING (1 << 29)
/* "..." */
#define
TC_NUMBER
(1 << 30)
#define
TC_LENGTH (1 << 20)
/* 'length' */
#define
TC_GETLINE (1 << 21)
/* 'getline' */
#define
TC_FUNCDECL (1 << 22)
/* 'function' 'func' */
#define
TC_BEGIN (1 << 23)
/* 'BEGIN' */
#define
TC_END (1 << 24)
/* 'END' */
#define
TC_EOF
(1 << 25)
#define
TC_VARIABLE (1 << 26)
/* name */
#define
TC_ARRAY (1 << 27)
/* name[ */
#define
TC_FUNCTION (1 << 28)
/* name( */
#define
TC_STRING (1 << 29)
/* "..." */
#define
TC_NUMBER
(1 << 30)
#ifndef debug_parse_print_tc
#define debug_parse_print_tc(n) do { \
if ((n) & TC_LPAREN ) debug_printf_parse(" LPAREN" ); \
if ((n) & TC_RPAREN ) debug_printf_parse(" RPAREN" ); \
if ((n) & TC_REGEXP ) debug_printf_parse(" REGEXP" ); \
if ((n) & TC_OUTRDR ) debug_printf_parse(" OUTRDR" ); \
if ((n) & TC_UOPPOST ) debug_printf_parse(" UOPPOST" ); \
if ((n) & TC_UOPPRE1 ) debug_printf_parse(" UOPPRE1" ); \
if ((n) & TC_BINOPX ) debug_printf_parse(" BINOPX" ); \
if ((n) & TC_IN ) debug_printf_parse(" IN" ); \
if ((n) & TC_COMMA ) debug_printf_parse(" COMMA" ); \
if ((n) & TC_PIPE ) debug_printf_parse(" PIPE" ); \
if ((n) & TC_UOPPRE2 ) debug_printf_parse(" UOPPRE2" ); \
if ((n) & TC_ARRTERM ) debug_printf_parse(" ARRTERM" ); \
if ((n) & TC_LBRACE ) debug_printf_parse(" LBRACE" ); \
if ((n) & TC_RBRACE ) debug_printf_parse(" RBRACE" ); \
if ((n) & TC_SEMICOL ) debug_printf_parse(" SEMICOL" ); \
if ((n) & TC_NEWLINE ) debug_printf_parse(" NEWLINE" ); \
if ((n) & TC_STATX ) debug_printf_parse(" STATX" ); \
if ((n) & TC_WHILE ) debug_printf_parse(" WHILE" ); \
if ((n) & TC_ELSE ) debug_printf_parse(" ELSE" ); \
if ((n) & TC_BUILTIN ) debug_printf_parse(" BUILTIN" ); \
if ((n) & TC_LENGTH ) debug_printf_parse(" LENGTH" ); \
if ((n) & TC_GETLINE ) debug_printf_parse(" GETLINE" ); \
if ((n) & TC_FUNCDECL) debug_printf_parse(" FUNCDECL"); \
if ((n) & TC_BEGIN ) debug_printf_parse(" BEGIN" ); \
if ((n) & TC_END ) debug_printf_parse(" END" ); \
if ((n) & TC_EOF ) debug_printf_parse(" EOF" ); \
if ((n) & TC_VARIABLE) debug_printf_parse(" VARIABLE"); \
if ((n) & TC_ARRAY ) debug_printf_parse(" ARRAY" ); \
if ((n) & TC_FUNCTION) debug_printf_parse(" FUNCTION"); \
if ((n) & TC_STRING ) debug_printf_parse(" STRING" ); \
if ((n) & TC_NUMBER ) debug_printf_parse(" NUMBER" ); \
} while (0)
static
void
debug_parse_print_tc
(
uint32_t
n
)
{
if
(
n
&
TC_LPAREN
)
debug_printf_parse
(
" LPAREN"
);
if
(
n
&
TC_RPAREN
)
debug_printf_parse
(
" RPAREN"
);
if
(
n
&
TC_REGEXP
)
debug_printf_parse
(
" REGEXP"
);
if
(
n
&
TC_OUTRDR
)
debug_printf_parse
(
" OUTRDR"
);
if
(
n
&
TC_UOPPOST
)
debug_printf_parse
(
" UOPPOST"
);
if
(
n
&
TC_UOPPRE1
)
debug_printf_parse
(
" UOPPRE1"
);
if
(
n
&
TC_BINOPX
)
debug_printf_parse
(
" BINOPX"
);
if
(
n
&
TC_IN
)
debug_printf_parse
(
" IN"
);
if
(
n
&
TC_COMMA
)
debug_printf_parse
(
" COMMA"
);
if
(
n
&
TC_PIPE
)
debug_printf_parse
(
" PIPE"
);
if
(
n
&
TC_UOPPRE2
)
debug_printf_parse
(
" UOPPRE2"
);
if
(
n
&
TC_ARRTERM
)
debug_printf_parse
(
" ARRTERM"
);
if
(
n
&
TC_LBRACE
)
debug_printf_parse
(
" LBRACE"
);
if
(
n
&
TC_RBRACE
)
debug_printf_parse
(
" RBRACE"
);
if
(
n
&
TC_SEMICOL
)
debug_printf_parse
(
" SEMICOL"
);
if
(
n
&
TC_NEWLINE
)
debug_printf_parse
(
" NEWLINE"
);
if
(
n
&
TC_STATX
)
debug_printf_parse
(
" STATX"
);
if
(
n
&
TC_WHILE
)
debug_printf_parse
(
" WHILE"
);
if
(
n
&
TC_ELSE
)
debug_printf_parse
(
" ELSE"
);
if
(
n
&
TC_BUILTIN
)
debug_printf_parse
(
" BUILTIN"
);
if
(
n
&
TC_LENGTH
)
debug_printf_parse
(
" LENGTH"
);
if
(
n
&
TC_GETLINE
)
debug_printf_parse
(
" GETLINE"
);
if
(
n
&
TC_FUNCDECL
)
debug_printf_parse
(
" FUNCDECL"
);
if
(
n
&
TC_BEGIN
)
debug_printf_parse
(
" BEGIN"
);
if
(
n
&
TC_END
)
debug_printf_parse
(
" END"
);
if
(
n
&
TC_EOF
)
debug_printf_parse
(
" EOF"
);
if
(
n
&
TC_VARIABLE
)
debug_printf_parse
(
" VARIABLE"
);
if
(
n
&
TC_ARRAY
)
debug_printf_parse
(
" ARRAY"
);
if
(
n
&
TC_FUNCTION
)
debug_printf_parse
(
" FUNCTION"
);
if
(
n
&
TC_STRING
)
debug_printf_parse
(
" STRING"
);
if
(
n
&
TC_NUMBER
)
debug_printf_parse
(
" NUMBER"
);
}
#endif
/* combined token classes ("token [class] sets") */
...
...
@@ -417,7 +418,7 @@ static const char tokenlist[] ALIGN1 =
"
\5
close"
"
\6
system"
"
\6
fflush"
"
\5
atan2"
"
\3
cos"
"
\3
exp"
"
\3
int"
"
\3
log"
"
\4
rand"
"
\3
sin"
"
\4
sqrt"
"
\5
srand"
"
\6
gensub"
"
\4
gsub"
"
\5
index"
/* "\6length" was here */
"
\6
gensub"
"
\4
gsub"
"
\5
index"
/* "\6length" was here */
"
\5
match"
"
\5
split"
"
\7
sprintf"
"
\3
sub"
"
\6
substr"
"
\7
systime"
"
\10
strftime"
"
\6
mktime"
"
\7
tolower"
"
\7
toupper"
NTC
...
...
@@ -1802,7 +1803,6 @@ static void parse_program(char *p)
}
/* for (;;) */
}
/* -------- program execution part -------- */
/* temporary variables allocator */
...
...
@@ -3510,7 +3510,6 @@ static var *evaluate(node *op, var *res)
#undef sreg
}
/* -------- main & co. -------- */
static
int
awk_exit
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录