Skip to content

Commit

Permalink
disallow begin inside indexing (#25614)
Browse files Browse the repository at this point in the history
part of #23354, #25458
  • Loading branch information
JeffBezanson authored Jan 18, 2018
1 parent 4f57e0a commit ae0a3e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ Language changes
* `=>` now has its own precedence level, giving it strictly higher precedence than
`=` and `,` ([#25391]).

* `begin` is disallowed inside indexing expressions, in order to enable the syntax
`a[begin]` (for selecting the first element) in the future ([#23354]).

* Underscores for `_italics_` and `__bold__` are now supported by the Base Markdown
parser. ([#25564])

Expand Down
2 changes: 2 additions & 0 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,8 @@

;; parse expressions or blocks introduced by syntactic reserved words
(define (parse-resword s word)
(if (and (eq? word 'begin) end-symbol)
(parser-depwarn s "\"begin\" inside indexing expression" ""))
(with-bindings
((expect-end-current-line (input-port-line (ts:port s))))
(with-normal-context
Expand Down

0 comments on commit ae0a3e9

Please sign in to comment.