libs: fix syntax.
parent
d54ac497c6
commit
b24a1c352d
|
@ -6,6 +6,6 @@ in: calendar.holidays.canada
|
|||
SINGLETONS: canada canadian-federal ;
|
||||
|
||||
HOLIDAY: canadian-thanksgiving-day october 2 monday-of-month ;
|
||||
HOLIDAY-NAME: canadian-thanksgiving-day canadian-federal "Thanksgiving Day"
|
||||
HOLIDAY-NAME: canadian-thanksgiving-day canadian-federal "Thanksgiving Day" ;
|
||||
|
||||
HOLIDAY-NAME: armistice-day commonwealth-of-nations "Remembrance Day"
|
||||
HOLIDAY-NAME: armistice-day commonwealth-of-nations "Remembrance Day" ;
|
||||
|
|
|
@ -7,15 +7,16 @@ in: calendar.holidays
|
|||
SINGLETONS: all world commonwealth-of-nations ;
|
||||
|
||||
<<
|
||||
SYNTAX: HOLIDAY:
|
||||
SYNTAX: \ HOLIDAY:
|
||||
scan-new-word
|
||||
dup "holiday" word-prop [
|
||||
dup H{ } clone "holiday" set-word-prop
|
||||
] unless
|
||||
parse-definition ( timestamp/n -- timestamp ) define-declared ;
|
||||
|
||||
SYNTAX: HOLIDAY-NAME:
|
||||
SYNTAX: \ HOLIDAY-NAME:
|
||||
let[ scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value
|
||||
";" expect
|
||||
value name holidays set-at ] ;
|
||||
>>
|
||||
|
||||
|
@ -53,4 +54,4 @@ M: all holidays
|
|||
] keep '[ _ swap "holiday" word-prop at ] map ;
|
||||
|
||||
HOLIDAY: armistice-day november 11 >>day ;
|
||||
HOLIDAY-NAME: armistice-day world "Armistice Day"
|
||||
HOLIDAY-NAME: armistice-day world "Armistice Day" ;
|
||||
|
|
|
@ -27,38 +27,38 @@ M: us-federal holidays
|
|||
{ [ sunday? not ] [ us-federal holiday? not ] } 1&& ;
|
||||
|
||||
HOLIDAY: new-years-day january 1 >>day ;
|
||||
HOLIDAY-NAME: new-years-day world "New Year's Day"
|
||||
HOLIDAY-NAME: new-years-day us-federal "New Year's Day"
|
||||
HOLIDAY-NAME: new-years-day world "New Year's Day" ;
|
||||
HOLIDAY-NAME: new-years-day us-federal "New Year's Day" ;
|
||||
|
||||
HOLIDAY: martin-luther-king-day january 3 monday-of-month ;
|
||||
HOLIDAY-NAME: martin-luther-king-day us-federal "Martin Luther King Day"
|
||||
HOLIDAY-NAME: martin-luther-king-day us-federal "Martin Luther King Day" ;
|
||||
|
||||
HOLIDAY: inauguration-day january 20 >>day [ dup 4 neg rem + ] change-year ;
|
||||
HOLIDAY-NAME: inauguration-day us "Inauguration Day"
|
||||
HOLIDAY-NAME: inauguration-day us "Inauguration Day" ;
|
||||
|
||||
HOLIDAY: washingtons-birthday february 3 monday-of-month ;
|
||||
HOLIDAY-NAME: washingtons-birthday us-federal "Washington's Birthday"
|
||||
HOLIDAY-NAME: washingtons-birthday us-federal "Washington's Birthday" ;
|
||||
|
||||
HOLIDAY: memorial-day may last-monday-of-month ;
|
||||
HOLIDAY-NAME: memorial-day us-federal "Memorial Day"
|
||||
HOLIDAY-NAME: memorial-day us-federal "Memorial Day" ;
|
||||
|
||||
HOLIDAY: independence-day july 4 >>day ;
|
||||
HOLIDAY-NAME: independence-day us-federal "Independence Day"
|
||||
HOLIDAY-NAME: independence-day us-federal "Independence Day" ;
|
||||
|
||||
HOLIDAY: labor-day september 1 monday-of-month ;
|
||||
HOLIDAY-NAME: labor-day us-federal "Labor Day"
|
||||
HOLIDAY-NAME: labor-day us-federal "Labor Day" ;
|
||||
|
||||
HOLIDAY: columbus-day october 2 monday-of-month ;
|
||||
HOLIDAY-NAME: columbus-day us-federal "Columbus Day"
|
||||
HOLIDAY-NAME: columbus-day us-federal "Columbus Day" ;
|
||||
|
||||
HOLIDAY-NAME: armistice-day us-federal "Veterans Day"
|
||||
HOLIDAY-NAME: armistice-day us-federal "Veterans Day" ;
|
||||
|
||||
HOLIDAY: thanksgiving-day november 4 thursday-of-month ;
|
||||
HOLIDAY-NAME: thanksgiving-day us-federal "Thanksgiving Day"
|
||||
HOLIDAY-NAME: thanksgiving-day us-federal "Thanksgiving Day" ;
|
||||
|
||||
HOLIDAY: christmas-day december 25 >>day ;
|
||||
HOLIDAY-NAME: christmas-day world "Christmas Day"
|
||||
HOLIDAY-NAME: christmas-day us-federal "Christmas Day"
|
||||
HOLIDAY-NAME: christmas-day world "Christmas Day" ;
|
||||
HOLIDAY-NAME: christmas-day us-federal "Christmas Day" ;
|
||||
|
||||
HOLIDAY: belly-laugh-day january 24 >>day ;
|
||||
|
||||
|
|
|
@ -31,5 +31,4 @@ ERROR: no-such-color name ;
|
|||
: named-color ( name -- color )
|
||||
dup colors at [ ] [ no-such-color ] ?if ;
|
||||
|
||||
SYNTAX: COLOR: scan-token named-color suffix! ;
|
||||
SYNTAX: color: scan-token named-color suffix! ;
|
||||
SYNTAX: \ color: scan-token named-color suffix! ;
|
||||
|
|
|
@ -13,5 +13,4 @@ in: colors.hex
|
|||
[ red>> ] [ green>> ] [ blue>> ] tri
|
||||
[ 255 * >integer ] tri@ "%02X%02X%02X" sprintf ;
|
||||
|
||||
SYNTAX: HEXCOLOR: scan-token hex>rgba suffix! ;
|
||||
SYNTAX: hexcolor: scan-token hex>rgba suffix! ;
|
||||
SYNTAX: \ hexcolor: scan-token hex>rgba suffix! ;
|
||||
|
|
|
@ -27,7 +27,7 @@ symbol: current-macro
|
|||
MACRO:: log-euler-op ( class def inputs -- quot )
|
||||
class inputs def inputs '[ [ current-macro get [ _ boa save-euler-op ] [ _ ndrop ] if ] _ _ nbi ] ;
|
||||
|
||||
SYNTAX: LOG-GML:
|
||||
SYNTAX: \ LOG-GML:
|
||||
let[
|
||||
(GML:) :> ( word name effect def )
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ FROM: kernel.private => declare ;
|
|||
scan-word \ (exec) create-method-in
|
||||
swap call( -- quot ) [ is-gml ] prepend ;
|
||||
|
||||
SYNTAX: EXEC: [ parse-definition ] (EXEC:) define ;
|
||||
SYNTAX: \ EXEC: [ parse-definition ] (EXEC:) define ;
|
||||
|
||||
SYNTAX: EXEC:: [ [ parse-definition ] parse-locals-definition drop ] (EXEC:) define ;
|
||||
SYNTAX: \ EXEC:: [ [ parse-definition ] parse-locals-definition drop ] (EXEC:) define ;
|
||||
|
||||
>>
|
||||
|
||||
|
@ -53,7 +53,7 @@ TUPLE: exec-name < identity-tuple name ;
|
|||
|
||||
MEMO: exec-name ( string -- name ) name \ exec-name boa ;
|
||||
|
||||
SYNTAX: exec" lexer get skip-blank parse-string exec-name suffix! ;
|
||||
SYNTAX: \ exec" lexer get skip-blank parse-string exec-name suffix! ;
|
||||
|
||||
ERROR: unbound-name { name name } ;
|
||||
|
||||
|
@ -185,10 +185,10 @@ global-dictionary [ H{ } clone ] initialize
|
|||
: (GML:) ( -- word name effect def )
|
||||
scan-gml-name scan-effect parse-definition ;
|
||||
|
||||
SYNTAX: GML:
|
||||
SYNTAX: \ GML:
|
||||
(GML:) define-gml-primitive ;
|
||||
|
||||
SYNTAX: GML::
|
||||
SYNTAX: \ GML::
|
||||
let[
|
||||
scan-gml-name :> ( word name )
|
||||
word [ parse-definition ] parse-locals-definition :> ( word def effect )
|
||||
|
|
|
@ -13,7 +13,7 @@ tags [ H{ } clone ] initialize
|
|||
|
||||
: define-chloe-tag ( name quot -- ) swap tags get set-at ;
|
||||
|
||||
SYNTAX: CHLOE:
|
||||
SYNTAX: \ CHLOE:
|
||||
scan-token parse-definition define-chloe-tag ;
|
||||
|
||||
CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0" ;
|
||||
|
@ -21,7 +21,7 @@ CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0" ;
|
|||
: chloe-name? ( name -- ? )
|
||||
url>> chloe-ns = ;
|
||||
|
||||
XML-NS: chloe-name http://factorcode.org/chloe/1.0
|
||||
XML-NS: chloe-name http://factorcode.org/chloe/1.0 ;
|
||||
|
||||
: required-attr ( tag name -- value )
|
||||
[ nip ] [ chloe-name attr ] 2bi
|
||||
|
|
|
@ -81,7 +81,7 @@ M: irc-message set-irc-command
|
|||
[ prefix>> ]
|
||||
[ command>> ]
|
||||
[ parameters>> " " join ]
|
||||
[ trailing>> dup [ char: : prefix ] when ]
|
||||
[ trailing>> dup [ char: \ : prefix ] when ]
|
||||
} cleave 4array sift " " join ;
|
||||
|
||||
<PRIVATE
|
||||
|
@ -109,7 +109,7 @@ PRIVATE>
|
|||
! SYNTAX: name string parameters ;
|
||||
! IRC: type "COMMAND" slot1 ...;
|
||||
! IRC: type "COMMAND" slot1 ... : trailing-slot;
|
||||
SYNTAX: IRC:
|
||||
SYNTAX: \ IRC:
|
||||
scan-new-class
|
||||
[ scan-object register-irc-message-type ] keep
|
||||
";" parse-tokens
|
||||
|
|
|
@ -137,7 +137,7 @@ PRIVATE>
|
|||
[ [ input-logging-quot ] 2keep drop error-logging-quot ]
|
||||
(define-logging) ;
|
||||
|
||||
SYNTAX: LOG:
|
||||
SYNTAX: \ LOG:
|
||||
! Syntax: name level
|
||||
scan-new-word dup scan-word ";" expect
|
||||
'[ 1array stack>message _ _ log-message ]
|
||||
|
|
|
@ -291,7 +291,7 @@ M: MATRIX n*V(*)V+M!
|
|||
M: MATRIX n*V(*)Vconj+M!
|
||||
(prepare-ger) [ XGERC ] dip ;
|
||||
|
||||
SYNTAX: XMATRIX{ \ } [ >MATRIX ] parse-literal ;
|
||||
SYNTAX: \ XMATRIX{ \ } [ >MATRIX ] parse-literal ;
|
||||
|
||||
M: MATRIX pprint-delims
|
||||
drop \ XMATRIX{ \ } ;
|
||||
|
|
|
@ -179,7 +179,7 @@ M: VECTOR n*V+V!
|
|||
M: VECTOR n*V!
|
||||
(prepare-scal) [ XSCAL ] dip ;
|
||||
|
||||
SYNTAX: XVECTOR{ \ } [ >VECTOR ] parse-literal ;
|
||||
SYNTAX: \ XVECTOR{ \ } [ >VECTOR ] parse-literal ;
|
||||
|
||||
M: VECTOR pprint-delims
|
||||
drop \ XVECTOR{ \ } ;
|
||||
|
|
|
@ -40,7 +40,7 @@ ERROR: malformed-complex obj ;
|
|||
: parse-complex ( seq -- complex )
|
||||
dup length 2 = [ first2-unsafe rect> ] [ malformed-complex ] if ;
|
||||
|
||||
SYNTAX: C{ \ } [ parse-complex ] parse-literal ;
|
||||
SYNTAX: \ C{ \ } [ parse-complex ] parse-literal ;
|
||||
|
||||
use: prettyprint.custom
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@ USING: accessors effects kernel lexer math.ranges parser
|
|||
sequences words ;
|
||||
in: math.derivatives.syntax
|
||||
|
||||
SYNTAX: DERIVATIVE: scan-object dup stack-effect in>> length [1,b]
|
||||
SYNTAX: \ DERIVATIVE: scan-object dup stack-effect in>> length [1,b]
|
||||
[ drop scan-object ] map ";" expect
|
||||
"derivative" set-word-prop ;
|
||||
|
|
|
@ -8,7 +8,7 @@ TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ;
|
|||
|
||||
: <rect> ( loc dim -- rect ) rect boa ; inline
|
||||
|
||||
SYNTAX: RECT: scan-object scan-object <rect> suffix! ;
|
||||
SYNTAX: \ RECT: scan-object scan-object <rect> suffix! ;
|
||||
|
||||
: <zero-rect> ( -- rect ) rect new ; inline
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ M: A >pprint-sequence ;
|
|||
M: A pprint* pprint-object ;
|
||||
|
||||
M: A pprint-delims drop \ A{ \ } ;
|
||||
SYNTAX: A{ \ } [ >A ] parse-literal ;
|
||||
SYNTAX: \ A{ \ } [ >A ] parse-literal ;
|
||||
|
||||
<c-type>
|
||||
byte-array >>class
|
||||
|
@ -78,20 +78,20 @@ FUNCTOR;
|
|||
[ define-specialized-cord ]
|
||||
[ create-word-in (define-simd-128-cord) ] 2bi ;
|
||||
|
||||
SYNTAX: SIMD-128-CORD:
|
||||
scan-word scan-token define-simd-128-cord ;
|
||||
SYNTAX: \ SIMD-128-CORD:
|
||||
scan-word scan-token ";" expect define-simd-128-cord ;
|
||||
|
||||
PRIVATE>
|
||||
>>
|
||||
|
||||
SIMD-128-CORD: char-16 char-32
|
||||
SIMD-128-CORD: uchar-16 uchar-32
|
||||
SIMD-128-CORD: short-8 short-16
|
||||
SIMD-128-CORD: ushort-8 ushort-16
|
||||
SIMD-128-CORD: int-4 int-8
|
||||
SIMD-128-CORD: uint-4 uint-8
|
||||
SIMD-128-CORD: longlong-2 longlong-4
|
||||
SIMD-128-CORD: ulonglong-2 ulonglong-4
|
||||
SIMD-128-CORD: float-4 float-8
|
||||
SIMD-128-CORD: double-2 double-4
|
||||
SIMD-128-CORD: char-16 char-32 ;
|
||||
SIMD-128-CORD: uchar-16 uchar-32 ;
|
||||
SIMD-128-CORD: short-8 short-16 ;
|
||||
SIMD-128-CORD: ushort-8 ushort-16 ;
|
||||
SIMD-128-CORD: int-4 int-8 ;
|
||||
SIMD-128-CORD: uint-4 uint-8 ;
|
||||
SIMD-128-CORD: longlong-2 longlong-4 ;
|
||||
SIMD-128-CORD: ulonglong-2 ulonglong-4 ;
|
||||
SIMD-128-CORD: float-4 float-8 ;
|
||||
SIMD-128-CORD: double-2 double-4 ;
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ M: A length drop N ; inline
|
|||
BOA-EFFECT define-inline
|
||||
|
||||
M: A pprint-delims drop \ A{ \ } ;
|
||||
SYNTAX: A{ \ } [ >A ] parse-literal ;
|
||||
SYNTAX: \ A{ \ } [ >A ] parse-literal ;
|
||||
|
||||
INSTANCE: A sequence ;
|
||||
|
||||
|
|
|
@ -225,5 +225,5 @@ ERROR: bad-suit-symbol ch ;
|
|||
: string>hand-name ( string -- string' )
|
||||
string>value value>hand-name ;
|
||||
|
||||
SYNTAX: HAND{
|
||||
SYNTAX: \ HAND{
|
||||
"}" [ card> ] map-tokens suffix! ;
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
USING: lexer sequences parser ;
|
||||
in: qw
|
||||
|
||||
SYNTAX: qw{ "}" parse-tokens suffix! ;
|
||||
SYNTAX: \ qw{ "}" parse-tokens suffix! ;
|
||||
|
|
|
@ -64,5 +64,5 @@ PREDICATE: role < mixin-class
|
|||
[ roles>slots define-tuple-class ]
|
||||
[ drop [ role? ] filter add-to-roles ] 3tri ;
|
||||
|
||||
SYNTAX: ROLE: parse-role-definition define-role ;
|
||||
SYNTAX: ROLE-TUPLE: parse-role-definition define-tuple-class-with-roles ;
|
||||
SYNTAX: \ ROLE: parse-role-definition define-role ;
|
||||
SYNTAX: \ ROLE-TUPLE: parse-role-definition define-tuple-class-with-roles ;
|
||||
|
|
|
@ -92,11 +92,11 @@ HELP: roman/mod
|
|||
|
||||
{ roman* roman/i roman/mod } related-words
|
||||
|
||||
HELP: ROMAN:
|
||||
HELP: \ roman:
|
||||
{ $description "A parsing word that reads the next token and converts it to an integer." }
|
||||
{ $examples
|
||||
{ $example "USING: prettyprint roman ;"
|
||||
"ROMAN: v ."
|
||||
"roman: v ."
|
||||
"5"
|
||||
}
|
||||
} ;
|
||||
|
@ -104,7 +104,7 @@ HELP: ROMAN:
|
|||
ARTICLE: "roman" "Roman numerals"
|
||||
"The " { $vocab-link "roman" } " vocabulary can convert numbers to and from the Roman numeral system and can perform arithmetic given Roman numerals as input." $nl
|
||||
"A parsing word for literal Roman numerals:"
|
||||
{ $subsections postpone\ ROMAN: }
|
||||
{ $subsections \ roman: }
|
||||
"Converting to Roman numerals:"
|
||||
{ $subsections
|
||||
>roman
|
||||
|
|
|
@ -37,7 +37,7 @@ USING: arrays kernel math roman roman.private sequences tools.test ;
|
|||
{ "i" "ii" } [ "v" "iii" roman/mod ] unit-test
|
||||
[ "iii" "iii" roman- ] must-fail
|
||||
|
||||
{ 30 } [ ROMAN: xxx ] unit-test
|
||||
{ 30 } [ roman: xxx ] unit-test
|
||||
|
||||
[ roman+ ] must-infer
|
||||
[ roman- ] must-infer
|
||||
|
|
|
@ -56,17 +56,17 @@ PRIVATE>
|
|||
|
||||
<<
|
||||
|
||||
SYNTAX: ROMAN-OP:
|
||||
SYNTAX: \ ROMAN-OP:
|
||||
scan-word [ name>> "roman" prepend create-word-in ] keep
|
||||
1quotation '[ _ binary-roman-op ]
|
||||
scan-effect define-declared ;
|
||||
scan-effect ";" expect define-declared ;
|
||||
|
||||
>>
|
||||
|
||||
ROMAN-OP: + ( x y -- z )
|
||||
ROMAN-OP: - ( x y -- z )
|
||||
ROMAN-OP: * ( x y -- z )
|
||||
ROMAN-OP: /i ( x y -- z )
|
||||
ROMAN-OP: /mod ( x y -- z w )
|
||||
ROMAN-OP: + ( x y -- z ) ;
|
||||
ROMAN-OP: - ( x y -- z ) ;
|
||||
ROMAN-OP: * ( x y -- z ) ;
|
||||
ROMAN-OP: /i ( x y -- z ) ;
|
||||
ROMAN-OP: /mod ( x y -- z w ) ;
|
||||
|
||||
SYNTAX: ROMAN: scan-token roman> suffix! ;
|
||||
SYNTAX: \ roman: scan-token roman> suffix! ;
|
||||
|
|
|
@ -113,7 +113,7 @@ TUPLE: slides < book ;
|
|||
: strip-tease ( data -- seq )
|
||||
first3 2 over length [a,b] [ head 3array ] with with with map ;
|
||||
|
||||
SYNTAX: STRIP-TEASE:
|
||||
SYNTAX: \ STRIP-TEASE:
|
||||
parse-definition strip-tease append! ;
|
||||
|
||||
\ slides H{
|
||||
|
|
|
@ -4,10 +4,10 @@ math.functions math.parser math.vectors memoize peg.ebnf sequences sequences.squ
|
|||
splitting strings xml.data xml.syntax ;
|
||||
in: svg
|
||||
|
||||
XML-NS: svg-name http://www.w3.org/2000/svg
|
||||
XML-NS: xlink-name http://www.w3.org/1999/xlink
|
||||
XML-NS: sodipodi-name http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd
|
||||
XML-NS: inkscape-name http://www.inkscape.org/namespaces/inkscape
|
||||
XML-NS: svg-name http://www.w3.org/2000/svg ;
|
||||
XML-NS: xlink-name http://www.w3.org/1999/xlink ;
|
||||
XML-NS: sodipodi-name http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd ;
|
||||
XML-NS: inkscape-name http://www.inkscape.org/namespaces/inkscape ;
|
||||
|
||||
: svg-string>number ( string -- number )
|
||||
H{ { char: E char: e } } substitute "e" split1
|
||||
|
|
|
@ -29,6 +29,6 @@ SYMBOLS: Cn Lu Ll Lt Lm Lo Mn Mc Me Nd Nl No Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So Zs
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: CATEGORY: parse-category define-category ;
|
||||
SYNTAX: \ CATEGORY: parse-category define-category ;
|
||||
|
||||
SYNTAX: CATEGORY-NOT: parse-category define-not-category ;
|
||||
SYNTAX: \ CATEGORY-NOT: parse-category define-not-category ;
|
||||
|
|
|
@ -186,6 +186,6 @@ PRIVATE>
|
|||
clone dup protocol>> '[ _ protocol-port or ] change-port ;
|
||||
|
||||
! Literal syntax
|
||||
SYNTAX: URL" lexer get skip-blank parse-string >url suffix! ;
|
||||
SYNTAX: \ URL" lexer get skip-blank parse-string >url suffix! ;
|
||||
|
||||
{ "urls" "prettyprint" } "urls.prettyprint" require-when
|
||||
|
|
|
@ -50,6 +50,6 @@ TUPLE: xkcd number image ;
|
|||
|
||||
C: <xkcd> xkcd ;
|
||||
|
||||
SYNTAX: XKCD: scan-number dup xkcd-image <xkcd> suffix! ;
|
||||
SYNTAX: \ XKCD: scan-number dup xkcd-image <xkcd> suffix! ;
|
||||
|
||||
M: xkcd pprint* image>> <image-section> add-section ;
|
||||
|
|
|
@ -25,7 +25,7 @@ PREDICATE: generated-xml-error < tuple class-of "xml-error-class" word-prop ;
|
|||
]
|
||||
} 3cleave ;
|
||||
|
||||
SYNTAX: XML-ERROR:
|
||||
SYNTAX: \ XML-ERROR:
|
||||
parse-tuple-definition pick save-location
|
||||
define-xml-error-class ;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ ARTICLE: "xml.syntax" "Syntax extensions for XML"
|
|||
{ $subsections
|
||||
{ "xml.syntax" "tags" }
|
||||
{ "xml.syntax" "literals" }
|
||||
postpone\ XML-NS:
|
||||
\ XML-NS:
|
||||
} ;
|
||||
|
||||
ARTICLE: { "xml.syntax" "tags" } "Dispatch on XML tag names"
|
||||
|
@ -104,6 +104,6 @@ let[
|
|||
XML[[ <a>pple</a> XML]] dispatch write"
|
||||
"apple" } ;
|
||||
|
||||
HELP: XML-NS:
|
||||
{ $syntax "XML-NS: name http://url" }
|
||||
HELP: \ XML-NS:
|
||||
{ $syntax "XML-NS: name http://url ;" }
|
||||
{ $description "Defines a new word of the given name which constructs XML names in the namespace of the given URL. The names constructed are memoized." } ;
|
||||
|
|
|
@ -34,7 +34,7 @@ TAG: neg calculate
|
|||
calc-arith
|
||||
] unit-test
|
||||
|
||||
XML-NS: foo http://blah.com
|
||||
XML-NS: foo http://blah.com ;
|
||||
|
||||
{ T{ name { main "bling" } { url "http://blah.com" } } } [ "bling" foo ] unit-test
|
||||
|
||||
|
|
|
@ -27,17 +27,17 @@ M: no-tag summary
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: TAGS:
|
||||
SYNTAX: \ TAGS:
|
||||
scan-new-word scan-effect ";" expect
|
||||
[ drop H{ } clone "xtable" set-word-prop ]
|
||||
[ define-tags ]
|
||||
2bi ;
|
||||
|
||||
SYNTAX: TAG:
|
||||
SYNTAX: \ TAG:
|
||||
scan-token scan-word parse-definition define-tag ;
|
||||
|
||||
SYNTAX: XML-NS:
|
||||
scan-new-word scan-token '[ f swap _ <name> ] ( string -- name ) define-memoized ;
|
||||
SYNTAX: \ XML-NS:
|
||||
scan-new-word scan-token ";" expect '[ f swap _ <name> ] ( string -- name ) define-memoized ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
|
@ -170,10 +170,10 @@ MACRO: interpolate-xml ( xml -- quot )
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: <XML
|
||||
SYNTAX: \ <XML
|
||||
"XML>" [ string>doc ] parse-def ;
|
||||
|
||||
SYNTAX: XML[[
|
||||
SYNTAX: \ XML[[
|
||||
"XML]]" [ string>chunk ] parse-def ;
|
||||
|
||||
use: vocabs.loader
|
||||
|
|
|
@ -10,7 +10,7 @@ in: xmode.loader.syntax
|
|||
: (parse-rule-tag) ( rule-set tag specs class -- )
|
||||
new swap init-from-tag swap add-rule ; inline
|
||||
|
||||
SYNTAX: RULE:
|
||||
SYNTAX: \ RULE:
|
||||
scan-token scan-word scan-word [
|
||||
[ parse-definition call( -- ) ] { } make
|
||||
swap [ (parse-rule-tag) ] 2curry
|
||||
|
|
|
@ -17,10 +17,16 @@
|
|||
[ dup <vocab-link> . flush vocab>literals ] map-zip
|
||||
|
||||
"resource:libs" vocabs-from
|
||||
{
|
||||
{ "brainfuck" "metar" "svg"
|
||||
"gml.parser" "infix.tokenizer"
|
||||
"math.blas.matrices" "math.blas.vectors"
|
||||
"math.vectors.simd" "math.vectors.simd.cords"
|
||||
"peg.pl0" "peg.javascript.parser" "peg.javascript.tokenizer"
|
||||
"yaml.conversion"
|
||||
} diff
|
||||
[ dup <vocab-link> . flush vocab>literals ] map-zip
|
||||
|
||||
|
||||
"resource:frameworks" vocabs-from
|
||||
{ "ui.theme.switching" "ui.backend.cocoa.views" "ui.backend.cocoa.tools"
|
||||
"ui.backend.gtk" "ui.backend.cocoa" "gpu.demos.raytrace" "gpu.demos.bunny"
|
||||
|
|
Loading…
Reference in New Issue