Skip to content

Commit

Permalink
tok
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Mar 17, 2024
1 parent 01d9ace commit a7edc35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/syntax/automath.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule AUTOMATH do
CoC Syntax:
*₁₀₁ -- 101-th Universe
[x : A) Exp -- Universal Quantifier
[x : A] Exp -- Universal Quantifier
(x : A) Exp -- Lambda
M N -- Application
L₁ -- Variable with de Bruijn index 1
Expand Down
12 changes: 4 additions & 8 deletions src/syntax/morte/om_tok.erl
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
-module(om_tok).
-description('Tokenizer').
-compile(export_all).
-define(is_space(C), C==$\r; C==$\s; C==$\t).
-define(is_num(C), C>=$0, C=<$9 ).
-define(is_alpha(C), C>=$a, C=<$z; C>=$A, C=<$Z;
C==$&; C==$|; C>=$0, C=<$9;
C==$@; C==$#; C==$_; C==$/;
C==$-; C==$+; C==$[; C==$];
C==$<; C==$>; C==$=; C==$.).
-define(is_termi(C), C==$!; C==$$; C==$%; C==$:;
C==$;; C==$~; C==$^; C==$?).
-define(is_space(C), C==$\r; C==$\s; C==$\t).
-define(is_termi(C), C==$!; C==$$; C==$%; C==$:; C==$;; C==$~; C==$^; C==$?).
-define(is_alpha(C), C>=$a, C=<$z; C>=$A, C=<$Z; C==$&; C==$|; C>=$0, C=<$9; C==$@; C==$#;
C==$_; C==$/; C==$-; C==$+; C==$[; C==$]; C==$<; C==$>; C==$=; C==$.).

tokens(P,<<>>, _, {_,C}, Acc) -> om:rev(stack(P,C,Acc));
tokens(P,<<"--"/utf8, R/binary>>, L, {_,C}, Acc) -> tokens(P,R,L,{c,[]}, stack(P,C,Acc));
Expand Down

0 comments on commit a7edc35

Please sign in to comment.