You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
741 B

#NQ⇐{0=2|+`('"'=𝕩)∧ ¬e∧¬(¯1⌽0∾"\\"⍷𝕩)∧e←0∾"\"""⍷𝕩}
#NQ⇐{0=2|+`('"'=𝕩)∧ ¬e∧¬(¬¯1⌽EC 𝕩)∧e←0∾"\"""⍷𝕩}
IQ ⇐{(≠`∨⊢) (»<`'\'=𝕩) < 𝕩='"'} #[I]n [Q]uotes (thanks dzaima)
NQ ⇐{¬ IQ 𝕩} #[N]ot [Q]uoted
Split⇐(⊢-˜+`׬)∘=⊔⊢ # group 𝕩 by the gap in 𝕨?
NQS ⇐((⊢-˜+`׬)∘(=∧NQ)⊔⊢) # group 𝕩 by the gap in 𝕨?
ES ⇐((⊢-˜¬×·+`0⊸»<⊢)∘∊˜⊔⊢) # [E]lement [S]plit
SS ⇐{ # [S]equence [S]plit
CW← +`⊸×⟜¬-⊢ # [C]ontiguous [W]indows
s←(≠𝕩)↑𝕨⍷𝕩
b←≠`((≠𝕨)⥊0)(»≠⊢)s
s CW b
}⊔⊢