From f7b8267052e01bf54499b6b38aea1e14139b87e7 Mon Sep 17 00:00:00 2001 From: Colin O'Keefe Date: Fri, 6 Sep 2024 09:45:30 -0700 Subject: [PATCH] Comment --- src/parser.lisp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/parser.lisp b/src/parser.lisp index f70b5617..94c3b951 100644 --- a/src/parser.lisp +++ b/src/parser.lisp @@ -905,8 +905,8 @@ FORMAL objects) which shadow memory names.") ;; When numerical expressions appear in gate-application parameter ;; positions, they are, whenever possible, evaluated to literal ;; numeric values. We would like for this to work with extern -;; functions in the same way they work with sin, cos, etc. The Quil -;; spec is stringent about what kinds of externs are permitted into +;; functions in the same way it works for sin, cos, etc. The Quil spec +;; is stringent about what kinds of externs are permitted into ;; arithmetic expressions (pure functions only), and requires that the ;; function signature be known. We choose check for this at parse ;; time. Doing so allows for numeric extern functions to evaluate @@ -926,14 +926,14 @@ arguments and that has a return type, then push its name into "Parse a PRAGMA out of the lines of tokens TOK-LINES." (match-line ((op :PRAGMA) word &rest word-toks) tok-lines (let ((first-payload - ;; In general, pragmas names are not meant to specially - ;; handled. But we need to handle EXTERN specifically - ;; because the Quil Spec requires that the pragma be - ;; called 'EXTERN', which is also a keyword for declaring - ;; extern functions. The tokenizer will see the string - ;; "EXTERN" and produce the token ':EXTERN, which is not a - ;; token of type ':NAME as is normally required by - ;; parse-pragma. + ;; In general, pragmas' names are not meant to specially + ;; handled. However, we need to handle EXTERN as a special + ;; case because the Quil Spec requires that the pragma be + ;; called 'EXTERN', and it just so happens that 'EXTERN' + ;; is a quil syntax keyword, used to declare extern + ;; procedures. The tokenizer will see the string "EXTERN" + ;; and produce the token ':EXTERN, which is not a token of + ;; type ':NAME as is normally required by parse-pragma. (case (token-type word) (:EXTERN "EXTERN") (:NAME (token-payload word))