Skip to content

Commit

Permalink
propagate inlining metadata to keyword sorter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and aviatesk committed Jul 12, 2022
1 parent c72625f commit 62a4a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ast.scm
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@
(and (if one (length= e 3) (length> e 2))
(eq? (car e) 'meta) (memq (cadr e) '(nospecialize specialize))))

(define (inline-meta? e)
(and (length= e 2)
(eq? (car e) 'meta) (memq (cadr e) '(inline noinline))))

(define (if-generated? e)
(and (length= e 4) (eq? (car e) 'if) (equal? (cadr e) '(generated))))

Expand Down
1 change: 1 addition & 0 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@
,(if (any kwarg? pargl) (gensy) UNUSED)
(call (core kwftype) ,ftype)) ,kw ,@pargl ,@vararg)
`(block
,@(filter inline-meta? prologue)
,@(let ((lnns (filter linenum? prologue)))
(if (pair? lnns)
(list (car lnns))
Expand Down

0 comments on commit 62a4a00

Please sign in to comment.