diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-13 17:15:27 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-13 17:15:27 +0200 |
commit | cbddc0ec9431b759567fa631dd0c19526d0ff775 (patch) | |
tree | baec265016b2357939ed00d7704c96762d50e3e9 /module/c/lex2.scm | |
parent | Comment out typechecks on token stream. (diff) | |
download | calp-cbddc0ec9431b759567fa631dd0c19526d0ff775.tar.gz calp-cbddc0ec9431b759567fa631dd0c19526d0ff775.tar.xz |
Basis of token convertion.
Diffstat (limited to '')
-rw-r--r-- | module/c/lex2.scm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/module/c/lex2.scm b/module/c/lex2.scm index 72f79f55..049cc48c 100644 --- a/module/c/lex2.scm +++ b/module/c/lex2.scm @@ -9,7 +9,10 @@ placemaker (type . lexeme-type) (body . lexeme-body) - (noexpand . lexeme-noexpand))) + (noexpand . lexeme-noexpand) + + parse-c-number + )) ;;; A.1 Lexical grammar ;;; A.1.1 Lexical elements @@ -371,6 +374,7 @@ + ;; At a number of places I chose token depending on the order of the rule. The ;; standard however says that the longest possible choice should be used. ;; 6.4 p. 4 @@ -392,3 +396,9 @@ "Parsing just failed. Chars: ~s" (list (peg:string result)) #f)) (cdr (peg:tree result)))))) + + + +(define (parse-c-number string) + (match-pattern constant string)) + |