-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransition_code.c
31 lines (29 loc) · 1.23 KB
/
transition_code.c
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
/* ************************************************************************** */
/* */
/* :::::::: */
/* transition_code.c :+: :+: */
/* +:+ */
/* By: jsaariko <[email protected]> +#+ */
/* +#+ */
/* Created: 2020/02/10 16:29:43 by jsaariko #+# #+# */
/* Updated: 2020/02/19 20:56:19 by jsaariko ######## odam.nl */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
t_transition_code get_transition(char token)
{
if (token == '-')
return (t_dash);
else if (token == '0')
return (t_zero);
else if (token == '.')
return (t_dot);
else if (token <= '9' && token >= '1')
return (t_num);
else if (token == '*')
return (t_ast);
else if (token == '\0')
return (t_exit);
else
return (t_error);
}