as: token: handle .data directive

This commit is contained in:
Mikael Pettersson 2019-12-15 17:25:24 +01:00
parent d18a218203
commit 3030d31385
2 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,7 @@
-spec from_symbol(string()) -> token().
from_symbol(Name) ->
case Name of
".data" -> ?T_DOT_DATA;
".file" -> ?T_DOT_FILE;
".globl" -> ?T_DOT_GLOBL;
".ident" -> ?T_DOT_IDENT;
@ -45,6 +46,7 @@ from_symbol(Name) ->
-spec format(token()) -> io_lib:chars().
format(Token) ->
case Token of
?T_DOT_DATA -> ".data";
?T_DOT_FILE -> ".file";
?T_DOT_GLOBL -> ".globl";
?T_DOT_IDENT -> ".ident";

View File

@ -26,6 +26,7 @@
%% with attributes (ordinary symbols, literals, errors).
%% reserved symbols including directives
-define(T_DOT_DATA, 'T_DOT_DATA'). % .data
-define(T_DOT_FILE, 'T_DOT_FILE'). % .file
-define(T_DOT_GLOBL, 'T_DOT_GLOBL'). % .globl
-define(T_DOT_IDENT, 'T_DOT_IDENT'). % .ident
@ -58,7 +59,8 @@
-define(T_NEWLINE, 'T_NEWLINE'). % <end-of-line>
-define(T_EOF, 'T_EOF'). % <end-of-file>
-type token() :: ?T_DOT_FILE
-type token() :: ?T_DOT_DATA
| ?T_DOT_FILE
| ?T_DOT_GLOBL
| ?T_DOT_IDENT
| ?T_DOT_POPSECTION