diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-04 21:43:36 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-03-04 21:43:36 +0100 |
commit | 2b9ac0c0a26b2c32277f3e17e12f69c2ec27bd4f (patch) | |
tree | d674ca6401944a151867f3affedce26f2a5aa17d /testdata | |
parent | a0a768b425dd9b5f7f763b6104d263f25a32c96b (diff) |
Prepared implementation of user defined tokens
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/osmlparser/user_defined_syntax.osml | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/testdata/osmlparser/user_defined_syntax.osml b/testdata/osmlparser/user_defined_syntax.osml new file mode 100644 index 0000000..3d44c29 --- /dev/null +++ b/testdata/osmlparser/user_defined_syntax.osml @@ -0,0 +1,58 @@ +\begin{document} + +\ontology#article{ + \struct#article[root=true] + \field + \childRef[ref=section] + \childRef[ref=paragraph] + \struct#section + \primitive#title[type=string,subtree=true] + \syntax + \open{==} + \close{==} + \field + \childRef[ref=paragraph] + \struct#paragraph[transparent=true] + \syntax + \close{\paragraph} + \field + \childRef[ref=text] + \childRef[ref=code] + \struct#code + \syntax + \open{`} + \close{`} + \field + \childRef[ref=text] + \struct#speech + \syntax + \open{<<} + \close{>>} + \fieldRef[ref=paragraph.$default] + \struct#text[transparent=true] + \primitive[type=string] +} + +\begin{article} +== This tests somewhat plays with user defined syntax == + +As you can see, just the tiny `\\syntax` definitions above make writing documents +much easier. + +For instance, this is a new paragraph. + +And here goes another one. + +All with the power of just adding `\\close\{\\paragraph\}` to the `\\syntax` +definition of the paragraph structure. + +<<Well, that's insane!>>, I hear you say. Right so! This indeed is insane. + +== One last thing == + +Did you notice how we started sections here? + +Sections can be allowed to use Wiki-like syntax with only three lines of code. +\end{article} +\end{document} + |