Skip to content

Commit

Permalink
Merge pull request #52 from non/topic/octal-escapes
Browse files Browse the repository at this point in the history
octal escapes for chars and strings
  • Loading branch information
hvesalai committed Apr 1, 2013
2 parents cc2db35 + e3f91eb commit 89c7138
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scala-mode2-syntax.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,19 @@
;; Escape Sequences (Chapter 1.3.6)
(defconst scala-syntax:escapeSequence-re "\\\\['btnfr\"\\\\]")

;; Octal Escape Sequences (Chapter 1.3.6)
(defconst scala-syntax:octalEscape-re (concat "\\\\[" scala-syntax:octalDigit-group "\\]\\{1,3\\}"))

;; Character Literals (Chapter 1.3.4)
(defconst scala-syntax:characterLiteral-re
(concat "\\('\\)\\(" "[^\\\\]" ;; should be just printable char, but this is faster
"\\|" scala-syntax:escapeSequence-re
"\\|" scala-syntax:octalEscape-re
"\\|" scala-syntax:UnicodeEscape-re "\\)\\('\\)"))

(defconst scala-syntax:string-escape-re
(concat scala-syntax:escapeSequence-re
"\\|" scala-syntax:octalEscape-re
"\\|" scala-syntax:UnicodeEscape-re))

;; String Literals (Chapter 1.3.5)
Expand Down

0 comments on commit 89c7138

Please sign in to comment.