Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
macrologist committed Sep 6, 2024
1 parent 5b4eea4 commit f7b8267
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/parser.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit f7b8267

Please sign in to comment.