Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
ed388fc8
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ed388fc8
编写于
12月 16, 2013
作者:
J
jp9000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replaced boolean trap parameter in the base lexer
上级
af5db87e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
11 deletion
+18
-11
libobs/util/cf-lexer.c
libobs/util/cf-lexer.c
+1
-1
libobs/util/config-file.c
libobs/util/config-file.c
+8
-7
libobs/util/lexer.c
libobs/util/lexer.c
+2
-1
libobs/util/lexer.h
libobs/util/lexer.h
+6
-1
libobs/util/text-lookup.c
libobs/util/text-lookup.c
+1
-1
未找到文件。
libobs/util/cf-lexer.c
浏览文件 @
ed388fc8
...
...
@@ -335,7 +335,7 @@ static bool cf_lexer_nexttoken(struct cf_lexer *lex, struct cf_token *out_token)
base_token_clear
(
&
start_token
);
cf_token_clear
(
out_token
);
while
(
lexer_getbasetoken
(
&
lex
->
base_lexer
,
&
token
,
false
))
{
while
(
lexer_getbasetoken
(
&
lex
->
base_lexer
,
&
token
,
PARSE_WHITESPACE
))
{
/* reclassify underscore as alpha for alnum tokens */
if
(
*
token
.
text
.
array
==
'_'
)
token
.
type
=
BASETOKEN_ALPHA
;
...
...
libobs/util/config-file.c
浏览文件 @
ed388fc8
...
...
@@ -101,7 +101,7 @@ static bool config_parse_string(struct lexer *lex, struct strref *ref,
struct
base_token
token
;
base_token_clear
(
&
token
);
while
(
lexer_getbasetoken
(
lex
,
&
token
,
false
))
{
while
(
lexer_getbasetoken
(
lex
,
&
token
,
PARSE_WHITESPACE
))
{
if
(
end
)
{
if
(
*
token
.
text
.
array
==
end
)
{
success
=
true
;
...
...
@@ -138,11 +138,11 @@ static void config_parse_section(struct config_section *section,
{
struct
base_token
token
;
while
(
lexer_getbasetoken
(
lex
,
&
token
,
false
))
{
while
(
lexer_getbasetoken
(
lex
,
&
token
,
PARSE_WHITESPACE
))
{
struct
strref
name
,
value
;
while
(
token
.
type
==
BASETOKEN_WHITESPACE
)
{
if
(
!
lexer_getbasetoken
(
lex
,
&
token
,
false
))
if
(
!
lexer_getbasetoken
(
lex
,
&
token
,
PARSE_WHITESPACE
))
return
;
}
...
...
@@ -150,7 +150,7 @@ static void config_parse_section(struct config_section *section,
if
(
*
token
.
text
.
array
==
'#'
)
{
do
{
if
(
!
lexer_getbasetoken
(
lex
,
&
token
,
false
))
PARSE_WHITESPACE
))
return
;
}
while
(
!
is_newline
(
*
token
.
text
.
array
));
...
...
@@ -198,17 +198,18 @@ static int config_parse(struct darray *sections, const char *file,
base_token_clear
(
&
token
);
while
(
lexer_getbasetoken
(
&
lex
,
&
token
,
false
))
{
while
(
lexer_getbasetoken
(
&
lex
,
&
token
,
PARSE_WHITESPACE
))
{
struct
config_section
*
section
;
while
(
token
.
type
==
BASETOKEN_WHITESPACE
)
{
if
(
!
lexer_getbasetoken
(
&
lex
,
&
token
,
false
))
if
(
!
lexer_getbasetoken
(
&
lex
,
&
token
,
PARSE_WHITESPACE
))
goto
complete
;
}
if
(
*
token
.
text
.
array
!=
'['
)
{
while
(
!
is_newline
(
*
token
.
text
.
array
))
{
if
(
!
lexer_getbasetoken
(
&
lex
,
&
token
,
false
))
if
(
!
lexer_getbasetoken
(
&
lex
,
&
token
,
PARSE_WHITESPACE
))
goto
complete
;
}
...
...
libobs/util/lexer.c
浏览文件 @
ed388fc8
...
...
@@ -250,11 +250,12 @@ static inline enum base_token_type get_char_token_type(const char ch)
}
bool
lexer_getbasetoken
(
struct
lexer
*
lex
,
struct
base_token
*
token
,
bool
ignore_whitespace
)
enum
ignore_whitespace
iws
)
{
const
char
*
offset
=
lex
->
offset
;
const
char
*
token_start
=
NULL
;
enum
base_token_type
type
=
BASETOKEN_NONE
;
bool
ignore_whitespace
=
(
iws
==
IGNORE_WHITESPACE
);
if
(
!
offset
)
return
false
;
...
...
libobs/util/lexer.h
浏览文件 @
ed388fc8
...
...
@@ -280,8 +280,13 @@ static inline void lexer_reset(struct lexer *lex)
lex
->
offset
=
lex
->
text
;
}
enum
ignore_whitespace
{
PARSE_WHITESPACE
,
IGNORE_WHITESPACE
};
EXPORT
bool
lexer_getbasetoken
(
struct
lexer
*
lex
,
struct
base_token
*
t
,
bool
ignore_whitespace
);
enum
ignore_whitespace
iws
);
EXPORT
void
lexer_getstroffset
(
const
struct
lexer
*
lex
,
const
char
*
str
,
uint32_t
*
row
,
uint32_t
*
col
);
...
...
libobs/util/text-lookup.c
浏览文件 @
ed388fc8
...
...
@@ -216,7 +216,7 @@ static bool lookup_gettoken(struct lexer *lex, struct strref *str)
base_token_clear
(
&
temp
);
strref_clear
(
str
);
while
(
lexer_getbasetoken
(
lex
,
&
temp
,
false
))
{
while
(
lexer_getbasetoken
(
lex
,
&
temp
,
PARSE_WHITESPACE
))
{
char
ch
=
*
temp
.
text
.
array
;
if
(
!
str
->
array
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录