syntax: add [[ ]] [=[ ]=] etc. fix docs.

locals-and-roots
Doug Coleman 2016-06-20 15:42:09 -07:00
parent 9bfdf92105
commit b4eebf65a9
4 changed files with 19 additions and 5 deletions

View File

@ -12,6 +12,7 @@ in: bootstrap.syntax
":" ":"
";" ";"
"![[" "![=[" "![==[" "![[" "![=[" "![==["
"[[" "[=[" "[==["
"PRIVATE<" "PRIVATE<"
"B{" "B{"
"BV{" "BV{"

View File

@ -70,6 +70,19 @@ in: bootstrap.syntax
"]==]" parse-multiline-string drop "]==]" parse-multiline-string drop
] define-core-syntax ] define-core-syntax
"[[" [
"]]" parse-multiline-string suffix!
] define-core-syntax
"[=[" [
"]=]" parse-multiline-string suffix!
] define-core-syntax
"[==[" [
"]==]" parse-multiline-string suffix!
] define-core-syntax
"PRIMITIVE:" [ "PRIMITIVE:" [
current-vocab name>> current-vocab name>>
scan-word scan-effect ";" expect ensure-primitive scan-word scan-effect ";" expect ensure-primitive

View File

@ -4,7 +4,7 @@ alien.prettyprint arrays assocs classes classes.struct
combinators combinators.short-circuit continuations fry kernel combinators combinators.short-circuit continuations fry kernel
libc make math math.parser mirrors prettyprint.backend libc make math math.parser mirrors prettyprint.backend
prettyprint.custom prettyprint.sections see.private sequences prettyprint.custom prettyprint.sections see.private sequences
slots strings summary words ; slots strings summary words see ;
in: classes.struct.prettyprint in: classes.struct.prettyprint
PRIVATE< PRIVATE<

View File

@ -3,8 +3,8 @@
USING: help.syntax help.markup peg peg.search words ; USING: help.syntax help.markup peg peg.search words ;
in: peg.ebnf in: peg.ebnf
HELP: EBNF< HELP: EBNF-MAIN{{
{ $syntax "EBNF<...ebnf... EBNF>" } { $syntax "EBNF-MAIN{{ ...ebnf... }}" }
{ $values { "...ebnf..." "EBNF DSL text" } } { $values { "...ebnf..." "EBNF DSL text" } }
{ $description { $description
"Creates a " { $vocab-link "peg" } "Creates a " { $vocab-link "peg" }
@ -15,7 +15,7 @@ HELP: EBNF<
{ $examples { $examples
{ $example { $example
"USING: kernel prettyprint peg.ebnf peg.search ;" "USING: kernel prettyprint peg.ebnf peg.search ;"
"\"abcdab\" EBNF< rule=\"a\" \"b\" => [[ drop \"foo\" ]] EBNF> replace ." "\"abcdab\" EBNF-MAIN{{ rule=\"a\" \"b\" => [[ drop \"foo\" ]] }} replace ."
"\"foocdfoo\"" "\"foocdfoo\""
} }
} ; } ;
@ -469,7 +469,7 @@ ARTICLE: "peg.ebnf" "EBNF"
"EBNF syntax. It provides three parsing words described below. These words all " "EBNF syntax. It provides three parsing words described below. These words all "
"accept the same EBNF syntax. The difference is in how they are used. " "accept the same EBNF syntax. The difference is in how they are used. "
{ $subsections { $subsections
\ EBNF< \ EBNF-MAIN{{
\ EBNF{{ \ EBNF{{
} }
"The EBNF syntax is composed of a series of rules of the form:" "The EBNF syntax is composed of a series of rules of the form:"