Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brian Smith
nettle
Commits
49c303e4
Commit
49c303e4
authored
16 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
(sexp_get_comment): New function.
(sexp_get_token): Use sexp_get_comment. Rev: nettle/tools/input.c:1.2
parent
e53a0a93
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/input.c
+21
-10
21 additions, 10 deletions
tools/input.c
with
21 additions
and
10 deletions
tools/input.c
+
21
−
10
View file @
49c303e4
...
@@ -180,7 +180,7 @@ sexp_get_quoted_char(struct sexp_input *input)
...
@@ -180,7 +180,7 @@ sexp_get_quoted_char(struct sexp_input *input)
static
void
static
void
sexp_get_token_string
(
struct
sexp_input
*
input
,
sexp_get_token_string
(
struct
sexp_input
*
input
,
struct
nettle_buffer
*
string
)
struct
nettle_buffer
*
string
)
{
{
assert
(
!
input
->
coding
);
assert
(
!
input
->
coding
);
assert
(
input
->
ctype
==
SEXP_NORMAL_CHAR
);
assert
(
input
->
ctype
==
SEXP_NORMAL_CHAR
);
...
@@ -334,6 +334,24 @@ sexp_get_string_length(struct sexp_input *input, enum sexp_mode mode,
...
@@ -334,6 +334,24 @@ sexp_get_string_length(struct sexp_input *input, enum sexp_mode mode,
sexp_get_char
(
input
);
sexp_get_char
(
input
);
}
}
static
void
sexp_get_comment
(
struct
sexp_input
*
input
,
struct
nettle_buffer
*
string
)
{
nettle_buffer_reset
(
string
);
assert
(
input
->
ctype
==
SEXP_NORMAL_CHAR
);
assert
(
input
->
c
==
';'
);
do
{
sexp_push_char
(
input
,
string
);
sexp_get_raw_char
(
input
);
}
while
(
input
->
ctype
==
SEXP_NORMAL_CHAR
&&
input
->
c
!=
'\n'
);
input
->
token
=
SEXP_COMMENT
;
}
/* When called, input->c should be the first character of the current
/* When called, input->c should be the first character of the current
* token.
* token.
*
*
...
@@ -409,15 +427,8 @@ sexp_get_token(struct sexp_input *input, enum sexp_mode mode,
...
@@ -409,15 +427,8 @@ sexp_get_token(struct sexp_input *input, enum sexp_mode mode,
if
(
mode
==
SEXP_CANONICAL
)
if
(
mode
==
SEXP_CANONICAL
)
die
(
"Comment encountered in canonical mode.
\n
"
);
die
(
"Comment encountered in canonical mode.
\n
"
);
do
sexp_get_comment
(
input
,
string
);
{
return
;
sexp_get_raw_char
(
input
);
if
(
input
->
ctype
!=
SEXP_NORMAL_CHAR
)
return
;
}
while
(
input
->
c
!=
'\n'
);
break
;
default:
default:
/* Ought to be a string */
/* Ought to be a string */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment