Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update the scanner leex code to satisfy what yecc expects.

  • Loading branch information...
commit 9e0445645d20da1db7a3ac989c4aeb4c1680baf3 1 parent a97cf8f
@jlouis authored
Showing with 16 additions and 14 deletions.
  1. +16 −14 src/inet_time_scanner.xrl
View
30 src/inet_time_scanner.xrl
@@ -6,24 +6,26 @@ ALPHA = [A-Z]
Rules.
-DIGIT+ :
+{DIGIT}+ :
{token,{integer,TokenLine,list_to_integer(TokenChars)}}.
-(,) : {token, comma}.
-(.) : {token, dot}.
-(\+) : {token, '+'}.
-(-) : {token, '-'}.
+(,) : {token, {comma, TokenLine, ','}}.
+(\.) : {token, {'.', TokenLine, '.'}}.
+(\+) : {token, {'+', TokenLine, '+'}}.
+(-) : {token, {'-', TokenLine, '-'}}.
(--) : {token, mminus}.
(---) : {token, mmminus}.
-(:) : {token, colon}.
-ALPHA : {token, case TokenChars of
- $Z -> 'Z';
- $z -> 'Z';
- $T -> 'T';
- $t -> 'T';
- $H -> 'H';
- $M -> 'M';
- $S -> 'S' end}.
+(:) : {token, {':', TokenLine, ':'}}.
+{ALPHA} : {token, {case TokenChars of
+ "Z" -> 'Z';
+ "z" -> 'Z';
+ "T" -> 'T';
+ "t" -> 'T';
+ "h" -> 'H';
+ "m" -> 'M';
+ "s" -> 'S';
+ _ -> unknown
+ end, TokenLine, dummy}}.
Erlang code.
Please sign in to comment.
Something went wrong with that request. Please try again.