Merge branch 'master' of git://factorcode.org/git/factor
commit
711d101154
|
@ -39,6 +39,8 @@ TUPLE: factor-expr expr ;
|
|||
|
||||
: ast>variable-expr ( ast -- obj ) 2nd variable-expr boa ;
|
||||
|
||||
: ast>factor-expr ( ast -- obj ) 2nd >string factor-expr boa ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
EBNF: expr
|
||||
|
@ -59,6 +61,8 @@ single-quoted = sq (!(sq) .)* sq => [[ ast>single-quoted-expr ]]
|
|||
double-quoted = dq (!(dq) .)* dq => [[ ast>double-quoted-expr ]]
|
||||
back-quoted = bq (!(bq) .)* bq => [[ ast>back-quoted-expr ]]
|
||||
|
||||
factor = "$(" (!(")") .)* ")" => [[ ast>factor-expr ]]
|
||||
|
||||
variable = "$" other => [[ ast>variable-expr ]]
|
||||
|
||||
glob-char = ("*" | "?")
|
||||
|
@ -73,7 +77,7 @@ glob = glob-beginning-string glob-char (glob-rest-string | glob-char)* => [[ ast
|
|||
|
||||
other = (!(white | "&" | ">" | ">>" | "<" | "|") .)+ => [[ >string ]]
|
||||
|
||||
element = (single-quoted | double-quoted | back-quoted | variable | glob | other)
|
||||
element = (single-quoted | double-quoted | back-quoted | factor | variable | glob | other)
|
||||
|
||||
command = (element _)+
|
||||
|
||||
|
@ -87,5 +91,4 @@ pipeline = _ command _ (in-file)? _ "|" _ (command _ "|" _)* command _ (to-file
|
|||
|
||||
submission = (pipeline | basic)
|
||||
|
||||
;EBNF
|
||||
|
||||
;EBNF
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
USING: kernel words continuations namespaces debugger sequences combinators
|
||||
USING: kernel parser words continuations namespaces debugger
|
||||
sequences combinators prettyprint
|
||||
system io io.files io.launcher sequences.deep
|
||||
accessors multi-methods newfx shell.parser ;
|
||||
|
||||
|
@ -41,6 +42,8 @@ METHOD: expand { glob-expr }
|
|||
[ ]
|
||||
if ;
|
||||
|
||||
METHOD: expand { factor-expr } expr>> eval unparse ;
|
||||
|
||||
METHOD: expand { object } ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
@ -49,7 +52,8 @@ METHOD: expand { object } ;
|
|||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
: run-sword ( basic-expr -- ) command>> unclip "shell" lookup execute ;
|
||||
: run-sword ( basic-expr -- )
|
||||
command>> expansion unclip "shell" lookup execute ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
|
Loading…
Reference in New Issue