FUEL: makes accessors and tuple slots with backslashes highlight correctly
							parent
							
								
									e8a62460aa
								
							
						
					
					
						commit
						a284660490
					
				| 
						 | 
				
			
			@ -183,7 +183,8 @@ these lines in your .emacs:
 | 
			
		|||
;;; Regexps galore:
 | 
			
		||||
 | 
			
		||||
;; Utility regexp used by other regexps to match a Factor symbol name
 | 
			
		||||
(setq-local symbol "\\(\\(?:\\sw\\|\\s_\\|\\s(\\|\\s)\\|\\s\\\\)+\\)")
 | 
			
		||||
(setq-local symbol-nc "\\(?:\\sw\\|\\s_\\|\\s(\\|\\s)\\|\\s\\\\)+")
 | 
			
		||||
(setq-local symbol (format "\\(%s\\)" symbol-nc))
 | 
			
		||||
(setq-local ws+ "[ \n\t]+")
 | 
			
		||||
(setq-local symbols-to-semicolon "\\([^;\t]*\\)\\(;\\)")
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -320,10 +321,10 @@ these lines in your .emacs:
 | 
			
		|||
  (one-symbol "<[^ >]+>"))
 | 
			
		||||
 | 
			
		||||
(defconst factor-getter-regex
 | 
			
		||||
  (one-symbol "\\(?:\\sw\\|\\s_\\)+>>"))
 | 
			
		||||
  (one-symbol (concat symbol-nc ">>")))
 | 
			
		||||
 | 
			
		||||
(defconst factor-setter-regex
 | 
			
		||||
  (one-symbol ">>\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+<<"))
 | 
			
		||||
  (one-symbol (format ">>%s\\|%s<<" symbol-nc symbol-nc)))
 | 
			
		||||
 | 
			
		||||
(defconst factor-stack-effect-regex
 | 
			
		||||
  "\\( ( [^)]* )\\)\\|\\( (( [^)]* ))\\)")
 | 
			
		||||
| 
						 | 
				
			
			@ -502,7 +503,8 @@ these lines in your .emacs:
 | 
			
		|||
     (4 'factor-font-lock-type-name nil t)
 | 
			
		||||
     ;; A slot is either a single symbol or a sequence along the
 | 
			
		||||
     ;; lines: { foo initial: "bar }
 | 
			
		||||
     ("\\(\\(?:\\sw\\|\\s_\\)+\\)\\|\\(?:{[ \n]+\\(\\(?:\\sw\\|\\s_\\)+\\)[^}]+\\)"
 | 
			
		||||
     (,(format
 | 
			
		||||
        "\\(?:{[ \n]+%s[^}]+\\)}\\|%s" symbol symbol)
 | 
			
		||||
      (factor-find-end-of-def)
 | 
			
		||||
      nil
 | 
			
		||||
      (1 'factor-font-lock-symbol nil t)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,8 @@
 | 
			
		|||
USING: accessors ;
 | 
			
		||||
IN: strange
 | 
			
		||||
 | 
			
		||||
TUPLE: oh\no { and/again initial: "meh" } ;
 | 
			
		||||
 | 
			
		||||
! FUEL Syntax Demo
 | 
			
		||||
!
 | 
			
		||||
! The purpose of this file is to test that corner cases are
 | 
			
		||||
| 
						 | 
				
			
			@ -18,12 +23,21 @@ TUPLE: a-tuple slot1 slot2 { slot3 integer } ;
 | 
			
		|||
 | 
			
		||||
! ! Symbol names
 | 
			
		||||
 | 
			
		||||
TUPLE: tup
 | 
			
		||||
    ko
 | 
			
		||||
    get\it
 | 
			
		||||
    { eh\ integer }
 | 
			
		||||
    { oh'ho } ;
 | 
			
		||||
 | 
			
		||||
! All slashes are symbol constituents.
 | 
			
		||||
: hack/slash ( -- x ) 10 ;
 | 
			
		||||
: hack/slash ( t -- x ) ko>> ;
 | 
			
		||||
 | 
			
		||||
: slash\hack ( -- y ) 20 ;
 | 
			
		||||
: um ( x y -- ) get\it<< ;
 | 
			
		||||
 | 
			
		||||
TUPLE: oh\no ;
 | 
			
		||||
: slash\hack ( m -- y )
 | 
			
		||||
    get\it>> dup >>get\it ;
 | 
			
		||||
 | 
			
		||||
TUPLE: oh\no { and/again initial: "meh" } ;
 | 
			
		||||
 | 
			
		||||
! As are quotes
 | 
			
		||||
: don't-do-that ( x -- y ) ;
 | 
			
		||||
| 
						 | 
				
			
			@ -56,3 +70,7 @@ ID-SYNTAX ID-SYNTAX
 | 
			
		|||
 | 
			
		||||
! ! Numbers
 | 
			
		||||
{ -55 -0x10 100,00 1,000,000 0x2000,0000 0b01 } drop
 | 
			
		||||
 | 
			
		||||
! ! Containers
 | 
			
		||||
V{ 1 2 3 } drop
 | 
			
		||||
HS{ 9 8 3 } drop
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue