FUEL: syntax fixes for MAIN-WINDOW:, LOG: and TUPLE: with initial values

char-rename
Björn Lindqvist 2016-07-30 19:00:14 +02:00
parent ca2aef8e67
commit 2e9704a406
4 changed files with 15 additions and 8 deletions

View File

@ -449,6 +449,7 @@ these lines in your .emacs:
,(factor-syntax factor-declaration-words-regex '("C")) ,(factor-syntax factor-declaration-words-regex '("C"))
,(factor-syntax factor-word-definition-regex '("P" "W")) ,(factor-syntax factor-word-definition-regex '("P" "W"))
,(factor-syntax (syntax-and-2-symbols '("ALIAS")) '("P" "W" "W")) ,(factor-syntax (syntax-and-2-symbols '("ALIAS")) '("P" "W" "W"))
,(factor-syntax (syntax-and-2-symbols '("LOG")) '("P" "W" ""))
,(factor-syntax (syntax-and-1-symbol '("ALIEN" "CHAR" "NAN")) '("P" "CT")) ,(factor-syntax (syntax-and-1-symbol '("ALIEN" "CHAR" "NAN")) '("P" "CT"))
,(factor-syntax factor-types-lines-regex '("P" "T")) ,(factor-syntax factor-types-lines-regex '("P" "T"))
,(factor-syntax factor-integer-regex '("N")) ,(factor-syntax factor-integer-regex '("N"))
@ -479,14 +480,18 @@ these lines in your .emacs:
(2 'factor-font-lock-type-name) (2 'factor-font-lock-type-name)
(3 'factor-font-lock-parsing-word nil t) (3 'factor-font-lock-parsing-word nil t)
(4 'factor-font-lock-type-name nil t) (4 'factor-font-lock-type-name nil t)
;; A slot is either a single symbol or a sequence along the ;; This allows three different slot styles:
;; lines: { foo initial: "bar } ;; 1) foo 2) { foo initial: 123 } 3) { foo initial: { 123 } }
(,(format (,(format
"\\(?:{[ \n]+%s[^}]+\\)}\\|%s" symbol symbol) "{%s%s[^}]+}%s}\\|{%s%s[^}]+}\\|%s"
ws+ symbol ws+
ws+ symbol
symbol)
(factor-find-end-of-def) (factor-find-end-of-def)
nil nil
(1 'factor-font-lock-symbol nil t) (1 'factor-font-lock-symbol nil t)
(2 'factor-font-lock-symbol nil t))) (2 'factor-font-lock-symbol nil t)
(3 'factor-font-lock-symbol nil t)))
,(factor-syntax factor-predicate-regex '("P" "T" "P" "T")) ,(factor-syntax factor-predicate-regex '("P" "T" "P" "T"))
;; Highlights alien function definitions. Types in stack effect ;; Highlights alien function definitions. Types in stack effect
;; declarations are given a bold face. ;; declarations are given a bold face.

View File

@ -24,7 +24,7 @@
"FROM" "FUNCTION:" "FUNCTION-ALIAS:" "FROM" "FUNCTION:" "FUNCTION-ALIAS:"
"INTERSECTION:" "INTERSECTION:"
"M" "M:" "MACRO" "MACRO:" "M" "M:" "MACRO" "MACRO:"
"MAIN-WINDOW:" "MEMO" "MEMO:" "METHOD" "MAIN-WINDOW" "MEMO" "MEMO:" "METHOD"
"SYNTAX" "SYNTAX"
"PREDICATE" "PRIMITIVE" "PROTOCOL" "PREDICATE" "PRIMITIVE" "PROTOCOL"
"SINGLETONS" "SINGLETONS"

View File

@ -52,5 +52,6 @@
(fuel-help--find-in)) (fuel-help--find-in))
"foob"))) "foob")))
;; fuel-xref
(ert-deftest fuel-xref-name () (ert-deftest fuel-xref-name ()
(should (equal (buffer-name (fuel-xref--buffer)) "*fuel xref*"))) (should (equal (buffer-name (fuel-xref--buffer)) "*fuel xref*")))

View File

@ -1,8 +1,6 @@
USING: accessors ; USING: accessors ;
IN: strange IN: strange
TUPLE: oh\no { and/again initial: "meh" } ;
! FUEL Syntax Demo ! FUEL Syntax Demo
! !
! The purpose of this file is to test that corner cases are ! The purpose of this file is to test that corner cases are
@ -12,11 +10,12 @@ TUPLE: oh\no { and/again initial: "meh" } ;
USING: alien.syntax kernel math ; USING: alien.syntax kernel math ;
IN: strange-syntax IN: strange-syntax
TUPLE: a-tuple slot1 slot2 { slot3 integer } ; TUPLE: a-tuple slot1 slot2 { slot3 integer } { slot4 initial: "hi" } ;
TUPLE: second-one ; TUPLE: second-one ;
USING: tools.test ; USING: tools.test ;
TUPLE: initial-array { slot2 initial: { 123 } } slot3 ;
! ! Strings ! ! Strings
"containing \"escapes" drop "containing \"escapes" drop
@ -37,6 +36,8 @@ TUPLE: tup
: slash\hack ( m -- y ) : slash\hack ( m -- y )
get\it>> dup >>get\it ; get\it>> dup >>get\it ;
LOG: what ever
TUPLE: oh\no { and/again initial: "meh" } ; TUPLE: oh\no { and/again initial: "meh" } ;
! As are quotes ! As are quotes