-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscanner_command_2.c
More file actions
45 lines (38 loc) · 1.42 KB
/
scanner_command_2.c
File metadata and controls
45 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* scanner_command_2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: seungbki <seungbki@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/28 06:07:04 by seungbki #+# #+# */
/* Updated: 2022/03/28 06:07:25 by seungbki ### ########.fr */
/* */
/* ************************************************************************** */
#include "scanner_command.h"
#include "token.h"
void set_plus(void *token, char lexeme)
{
((t_token *)token)->is_plus = 1;
(void)lexeme;
}
void set_minus(void *token, char lexeme)
{
((t_token *)token)->is_minus = 1;
(void)lexeme;
}
void set_precision(void *token, char lexeme)
{
((t_token *)token)->is_precision = 1;
(void)lexeme;
}
void set_zero(void *token, char lexeme)
{
((t_token *)token)->is_zero = 1;
(void)lexeme;
}
void add_width(void *token, char lexeme)
{
((t_token *)token)->width *= 10;
((t_token *)token)->width += lexeme - '0';
}