[moulette] lexer accepts '.'
[ozulis.git] / src / moulette / bison / lexer.l
blob4af62f87273fde84f056d9e4eff3a11c45db5bdf
1 %option reentrant noyywrap batch
2 %option bison-bridge bison-locations yylineno
3 %option warn
4 %option prefix="moulette_"
6 %{
7 #include <stdio.h>
8 #include <stdlib.h>
10 #include <ozulis/core/assert.hh>
11 #include "parser.hh"
13 #define YY_USER_ACTION                                  \
14   yylloc->first_line = yylineno;                        \
15   yylloc->last_line = yylineno;                         \
16   yylloc->first_column = yylloc->last_column;           \
17   yylloc->last_column += yyleng;
23 [ \t]+                  /* ignore whitespace */;
24 #.*$                    /* line comment */
26 \n                      return '\n';
27 test                    return TEST;
28 [-a-zA-Z_0-9\.](([-a-zA-Z_0-9 \.]+)?[-a-zA-Z_0-9\.])? yylval->string = strdup(yytext); return ID;
30 .                       return yytext[0]; // error