wlang 0.8.5 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +65 -0
- data/README.rdoc +85 -31
- data/bin/wlang +5 -0
- data/doc/specification/dialect.wtpl +14 -0
- data/doc/specification/dialects.wtpl +3 -0
- data/doc/specification/glossary.wtpl +4 -4
- data/doc/specification/rulesets.wtpl +9 -9
- data/doc/specification/specification.css +1 -0
- data/doc/specification/specification.html +68 -5
- data/doc/specification/specification.wtpl +12 -12
- data/doc/specification/specification.yml +9 -9
- data/doc/specification/symbols.wtpl +8 -8
- data/lib/wlang.rb +297 -75
- data/lib/wlang/dialect.rb +7 -3
- data/lib/wlang/dialects/coderay_dialect.rb +4 -4
- data/lib/wlang/dialects/plain_text_dialect.rb +13 -19
- data/lib/wlang/dialects/redcloth_dialect.rb +16 -0
- data/lib/wlang/dialects/ruby_dialect.rb +16 -2
- data/lib/wlang/dialects/standard_dialects.rb +20 -0
- data/lib/wlang/dialects/xhtml_dialect.rb +24 -1
- data/lib/wlang/encoder.rb +1 -1
- data/lib/wlang/encoder_set.rb +5 -0
- data/lib/wlang/errors.rb +70 -6
- data/lib/wlang/ext/hash_methodize.rb +13 -0
- data/lib/wlang/{ruby_extensions.rb → ext/string.rb} +9 -5
- data/lib/wlang/hash_scope.rb +89 -0
- data/lib/wlang/hosted_language.rb +146 -0
- data/lib/wlang/parser.rb +189 -126
- data/lib/wlang/parser_state.rb +94 -0
- data/lib/wlang/rule_set.rb +16 -3
- data/lib/wlang/rulesets/basic_ruleset.rb +14 -6
- data/lib/wlang/rulesets/buffering_ruleset.rb +20 -29
- data/lib/wlang/rulesets/context_ruleset.rb +16 -20
- data/lib/wlang/rulesets/imperative_ruleset.rb +4 -4
- data/lib/wlang/rulesets/ruleset_utils.rb +26 -5
- data/lib/wlang/template.rb +16 -34
- data/lib/wlang/wlang_command.rb +4 -7
- data/lib/wlang/wlang_command_options.rb +5 -0
- data/test/blackbox/basic/execution_1.exp +1 -0
- data/test/blackbox/basic/execution_1.tpl +1 -0
- data/test/blackbox/basic/execution_2.exp +1 -0
- data/test/blackbox/basic/execution_2.tpl +1 -0
- data/test/blackbox/basic/execution_3.exp +1 -0
- data/test/blackbox/basic/execution_3.tpl +1 -0
- data/test/blackbox/basic/execution_4.exp +1 -0
- data/test/blackbox/basic/execution_4.tpl +1 -0
- data/test/blackbox/basic/inclusion_1.exp +1 -0
- data/test/blackbox/basic/inclusion_1.tpl +1 -0
- data/test/blackbox/basic/inclusion_2.exp +1 -0
- data/test/blackbox/basic/inclusion_2.tpl +1 -0
- data/test/blackbox/basic/injection_1.exp +1 -0
- data/test/blackbox/basic/injection_1.tpl +1 -0
- data/test/blackbox/basic/injection_2.exp +1 -0
- data/test/blackbox/basic/injection_2.tpl +1 -0
- data/test/blackbox/basic/modulation_1.exp +1 -0
- data/test/blackbox/basic/modulation_1.tpl +1 -0
- data/test/blackbox/basic/modulation_2.exp +1 -0
- data/test/blackbox/basic/modulation_2.tpl +1 -0
- data/test/blackbox/basic/recursive_app_1.exp +1 -0
- data/test/blackbox/basic/recursive_app_1.tpl +1 -0
- data/test/blackbox/basic/recursive_app_2.exp +1 -0
- data/test/blackbox/basic/recursive_app_2.tpl +1 -0
- data/test/blackbox/buffering/data_1.rb +1 -0
- data/test/blackbox/buffering/data_assignment_1.exp +1 -0
- data/test/blackbox/buffering/data_assignment_1.tpl +1 -0
- data/test/blackbox/buffering/data_assignment_2.exp +1 -0
- data/test/blackbox/buffering/data_assignment_2.tpl +1 -0
- data/test/blackbox/buffering/data_assignment_3.exp +1 -0
- data/test/blackbox/buffering/data_assignment_3.tpl +1 -0
- data/test/blackbox/buffering/data_assignment_4.exp +1 -0
- data/test/blackbox/buffering/data_assignment_4.tpl +1 -0
- data/test/blackbox/buffering/input_1.exp +1 -0
- data/test/blackbox/buffering/input_1.tpl +1 -0
- data/test/blackbox/buffering/input_2.exp +1 -0
- data/test/blackbox/buffering/input_2.tpl +1 -0
- data/test/blackbox/buffering/input_3.exp +1 -0
- data/test/blackbox/buffering/input_3.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion.exp +1 -0
- data/test/blackbox/buffering/input_inclusion.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_1.exp +0 -0
- data/test/blackbox/buffering/input_inclusion_1.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_2.exp +1 -0
- data/test/blackbox/buffering/input_inclusion_2.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_3.exp +1 -0
- data/test/blackbox/buffering/input_inclusion_3.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_4.exp +0 -0
- data/test/blackbox/buffering/input_inclusion_4.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_5.exp +1 -0
- data/test/blackbox/buffering/input_inclusion_5.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_6.exp +1 -0
- data/test/blackbox/buffering/input_inclusion_6.tpl +1 -0
- data/test/blackbox/buffering/input_inclusion_7.exp +0 -0
- data/test/blackbox/buffering/input_inclusion_7.tpl +1 -0
- data/test/blackbox/buffering/text_1.txt +1 -0
- data/test/blackbox/buffering/wlang.txt +1 -0
- data/test/blackbox/context/assignment_1.exp +1 -0
- data/test/blackbox/context/assignment_1.tpl +1 -0
- data/test/blackbox/context/assignment_2.exp +1 -0
- data/test/blackbox/context/assignment_2.tpl +1 -0
- data/test/blackbox/context/assignment_3.exp +2 -0
- data/test/blackbox/context/assignment_3.tpl +2 -0
- data/test/blackbox/context/assignment_4.exp +1 -0
- data/test/blackbox/context/assignment_4.tpl +1 -0
- data/test/blackbox/context/block_assignment_1.exp +1 -0
- data/test/blackbox/context/block_assignment_1.tpl +1 -0
- data/test/blackbox/context/block_assignment_2.exp +1 -0
- data/test/blackbox/context/block_assignment_2.tpl +1 -0
- data/test/blackbox/context/modulo_assignment_1.exp +1 -0
- data/test/blackbox/context/modulo_assignment_1.tpl +1 -0
- data/test/blackbox/context/modulo_assignment_2.exp +1 -0
- data/test/blackbox/context/modulo_assignment_2.tpl +1 -0
- data/test/blackbox/data_1.rb +1 -0
- data/test/blackbox/test_all.rb +59 -0
- data/test/spec/basic_object.spec +40 -0
- data/test/spec/global_extensions.rb +2 -0
- data/test/spec/hash_scope.spec +76 -0
- data/test/spec/redcloth_dialect.spec +24 -0
- data/test/spec/test_all.rb +8 -0
- data/test/spec/wlang.spec +53 -0
- data/test/spec/xhtml_dialect.spec +23 -0
- data/test/{test_all.rb → unit/test_all.rb} +1 -1
- data/test/{wlang → unit/wlang}/anagram_bugs_test.rb +2 -2
- data/test/{wlang → unit/wlang}/basic_ruleset_test.rb +1 -1
- data/test/{wlang → unit/wlang}/buffering_ruleset_test.rb +4 -4
- data/test/{wlang → unit/wlang}/buffering_template1.wtpl +0 -0
- data/test/{wlang → unit/wlang}/buffering_template2.wtpl +0 -0
- data/test/{wlang → unit/wlang}/buffering_template3.wtpl +0 -0
- data/test/unit/wlang/buffering_template4.wtpl +1 -0
- data/test/unit/wlang/buffering_template5.wtpl +1 -0
- data/test/{wlang → unit/wlang}/context_ruleset_test.rb +0 -0
- data/test/{wlang → unit/wlang}/data.rb +0 -0
- data/test/{wlang → unit/wlang}/encoder_set_test.rb +0 -0
- data/test/{wlang → unit/wlang}/imperative_ruleset_test.rb +0 -0
- data/test/{wlang → unit/wlang}/intelligent_buffer_test.rb +0 -0
- data/test/{wlang → unit/wlang}/othersymbols_test.rb +0 -0
- data/test/{wlang → unit/wlang}/parser_test.rb +10 -11
- data/test/{wlang → unit/wlang}/plain_text_dialect_test.rb +0 -0
- data/test/{wlang → unit/wlang}/ruby_dialect_test.rb +0 -0
- data/test/{wlang → unit/wlang}/ruby_expected.rb +0 -0
- data/test/{wlang → unit/wlang}/ruby_template.wrb +0 -0
- data/test/{wlang → unit/wlang}/ruleset_utils_test.rb +0 -0
- data/test/{wlang → unit/wlang}/specification_examples_test.rb +2 -2
- data/test/{wlang → unit/wlang}/test_utils.rb +1 -1
- data/test/{wlang → unit/wlang}/wlang_test.rb +0 -0
- metadata +135 -42
- data/lib/wlang/basic_object.rb +0 -19
- data/lib/wlang/parser_context.rb +0 -139
- data/test/sandbox.rb +0 -1
- data/test/wlang/buffering_template4.wtpl +0 -1
- data/test/wlang/buffering_template5.wtpl +0 -1
- data/test/wlang/parser_context_test.rb +0 -29
data/CHANGELOG.rdoc
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
== Changelog
|
|
2
|
+
|
|
3
|
+
=== Version 0.9.1
|
|
4
|
+
|
|
5
|
+
==== Bug fixes
|
|
6
|
+
|
|
7
|
+
- #307, about HashScope.has_key? which returned nil instead of false in some situations
|
|
8
|
+
|
|
9
|
+
==== Broken features and APIs (by order of importance)
|
|
10
|
+
|
|
11
|
+
- HostedLanguage::DSL is strictly private and should be reopened. Methods added to this class
|
|
12
|
+
will never be available in templates. Use HostedLanguage.variable_missing instead.
|
|
13
|
+
- ::WLang::BasicObject has been removed. HostedLanguage::DSL implements its own strategy, which
|
|
14
|
+
is spec tested in test/spec/basic_object.spec
|
|
15
|
+
|
|
16
|
+
==== New features (by order of importance)
|
|
17
|
+
|
|
18
|
+
- WLang does not requires the rdoc gem by default
|
|
19
|
+
- A new encoder redcloth/xhtml allows using Textile markups easily
|
|
20
|
+
- The wlang/xhtml dialect provides a tag helper for links @{...}{...}
|
|
21
|
+
- The parser class returns friendly messages when a rule is ill-implemented
|
|
22
|
+
|
|
23
|
+
=== Version 0.9.0
|
|
24
|
+
|
|
25
|
+
==== Broken features and APIs (by order of importance)
|
|
26
|
+
|
|
27
|
+
- Major broken API in WLang.instantiate and WLang.file_instantiate which do not allow passing
|
|
28
|
+
buffers anymore
|
|
29
|
+
- Hash are not methodized by default anymore (major broken feature with 0.8.x versions)
|
|
30
|
+
- Expressions 'a la' PHP w@w (sections/.../.../id) are not supported anymore
|
|
31
|
+
- The default hosted language raises a WLang::UndefinedVariableError when a variable cannot be
|
|
32
|
+
found in the current template scope (0.8.x versions returned nil in this case)
|
|
33
|
+
- Template.initialize does not take a default context anymore
|
|
34
|
+
- WLang::Parser.context_xxx do not exist anymore. Use branch(...) instead
|
|
35
|
+
- WLang::Parser::Context removed, and WLang::HashScope introduced
|
|
36
|
+
- WLang::Parser instance variables are all made protected
|
|
37
|
+
|
|
38
|
+
==== New features (by order of importance)
|
|
39
|
+
|
|
40
|
+
- WLang::HostingLanguage introduced, with a default one for Ruby. The hosting language
|
|
41
|
+
is the way to provide a main scope, accessible to all templates at once.
|
|
42
|
+
- WLang::HostingLanguage is not sensitive to the difference between symbol keys and strings
|
|
43
|
+
- Buffering and Context rulesets now branch the current parser instead of creating a new one
|
|
44
|
+
- WLang::Error and subclasses propose a backtrace information
|
|
45
|
+
- WLang::Parser refactored to encapsulate the whole state in another class (WLang::Parser::State)
|
|
46
|
+
- WLang facade has been made much more robust as it now checks all its arguments.
|
|
47
|
+
- WLang::dialect may now be used to ensure dialect instances from both Dialect args and qualified names.
|
|
48
|
+
- Introduction of WLang.template and WLang.file_template
|
|
49
|
+
- plain-text dialect proposes new camel-based encoders
|
|
50
|
+
- wlang/active-string dialect has the imperative rule set included
|
|
51
|
+
- sql dialect has been added
|
|
52
|
+
- ruby dialect proposes a method-case encoder
|
|
53
|
+
|
|
54
|
+
=== Version 0.8.5
|
|
55
|
+
|
|
56
|
+
- Enhances error messages a lot
|
|
57
|
+
- Some bug fixes for ruby 0.8.7
|
|
58
|
+
|
|
59
|
+
=== Version 0.8.4
|
|
60
|
+
|
|
61
|
+
- Migration from svn.chefbe.net to github.com
|
|
62
|
+
|
|
63
|
+
=== Version 0.8.0
|
|
64
|
+
|
|
65
|
+
- First public version
|
data/README.rdoc
CHANGED
|
@@ -8,25 +8,39 @@ escaping and the like. WLang proposes a generic engine that you can extend to fi
|
|
|
8
8
|
proposes standard instantiations of this engine for common tasks such as creating SQL queries,
|
|
9
9
|
instantiating web pages, etc.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
=== A collection of typical encoders
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
The first basic usage of WLang is to provide a collection of text encoders:
|
|
14
|
+
|
|
15
|
+
WLang::encode('&', 'xhtml/entities-encoding') # &
|
|
16
|
+
WLang::encode("O'Neil", 'sql/single-quoting') # O\'Neil
|
|
17
|
+
WLang::encode("O'Neil", 'sql/sybase/single-quoting') # O''Neil
|
|
18
|
+
...
|
|
19
|
+
WLang::encode("hello world", 'plain-text/camel') # HelloWorld
|
|
20
|
+
WLang::encode("hello world", 'plain-text/lower-camel') # helloWorld
|
|
21
|
+
...
|
|
22
|
+
WLang::encode("helloWorld", 'ruby/method-case') # hello_world
|
|
23
|
+
|
|
24
|
+
=== A powerful alternative to ruby string interpolation
|
|
25
|
+
|
|
26
|
+
The second usage is to have shortcuts for using these encoders in typical
|
|
27
|
+
situations:
|
|
28
|
+
|
|
29
|
+
# Hello world!
|
|
30
|
+
"Hello ${who}!".wlang(:who => 'world')
|
|
31
|
+
|
|
32
|
+
# Hello cruel & world!
|
|
33
|
+
"Hello ${who}!".wlang({:who => 'cruel & world'}, 'wlang/xhtml')
|
|
34
|
+
|
|
35
|
+
# Hello blambeau, llambeau
|
|
36
|
+
"Hello *{authors as a}{${a}}{, }".wlang(:authors => ['blambeau', 'llambeau'])
|
|
26
37
|
|
|
27
|
-
|
|
38
|
+
# INSERT INTO people VALUES ('O\'Neil')
|
|
39
|
+
INSERT INTO people VALUES ('{who}')".wlang(:who => "O'Neil")
|
|
40
|
+
|
|
41
|
+
=== A powerful templating engine
|
|
28
42
|
|
|
29
|
-
(for bold words, see terminology later)
|
|
43
|
+
But the main usage of _wlang_ is as follows (for bold words, see terminology later):
|
|
30
44
|
you have a *template* file (written in a given _wlang_ *dialect*), you have some
|
|
31
45
|
instantiation *context* (data provided through a Ruby Hash or a yaml file for
|
|
32
46
|
example) and you would like to instantiate the template with that data.
|
|
@@ -46,23 +60,63 @@ the template is straightforward:
|
|
|
46
60
|
|
|
47
61
|
require 'wlang'
|
|
48
62
|
context = {"title" => "Hello world in WLang", "who" => "Alice"}
|
|
49
|
-
WLang.file_instantiate("template.whtml", context
|
|
63
|
+
STDOUT << WLang.file_instantiate("template.whtml", context)
|
|
50
64
|
|
|
51
|
-
===
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
=== Behind the scene
|
|
66
|
+
|
|
67
|
+
- WLang helps you avoiding SQL injection and XSS attacks through the same tags reacting differently
|
|
68
|
+
in different contexts.
|
|
69
|
+
- WLang understands your context (and its dialect) from the template file extension
|
|
70
|
+
- WLang provides a rich collection of pre-defined tags and dialects
|
|
71
|
+
- WLang allows you to create your own encoders, tags and dialects while reusing existing ones
|
|
72
|
+
- WLang may change the current dialect during the template instantiation itself (generating
|
|
73
|
+
html with embedded javascript is easy and natural)
|
|
74
|
+
- WLang is able to generate wlang code without any perturabation
|
|
75
|
+
|
|
76
|
+
=== Additional examples (availability of the tags may depend on the dialect)
|
|
77
|
+
|
|
78
|
+
- Include text files on the fly
|
|
65
79
|
|
|
80
|
+
<<{my_file.html}
|
|
81
|
+
|
|
82
|
+
- Instantiate sub-templates on the fly, passing data as arguments
|
|
83
|
+
|
|
84
|
+
<<+{my_sub_template.whtml using who: 'wlang'}
|
|
85
|
+
|
|
86
|
+
- Load data from yaml or ruby files on the fly
|
|
87
|
+
|
|
88
|
+
<<={resources.yaml as resources}{
|
|
89
|
+
*{resources as r}{ ${r} }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- WLang instrospection (basic example)
|
|
93
|
+
|
|
94
|
+
context = {:varname => 'who', :who => 'wlang'}
|
|
95
|
+
"Hello ${${varname}}!".wlang(context) # => Hello wlang!
|
|
96
|
+
|
|
97
|
+
- Generate a wlang template and instantiate it after that
|
|
98
|
+
|
|
99
|
+
dialect = 'wlang/active-string'
|
|
100
|
+
tpl = "Hello $(${varname})!" # => Hello $(${varname})
|
|
101
|
+
tpl = tpl.wlang(:varname => 'who') # => Hello $(who)!
|
|
102
|
+
tpl = tpl.wlang({:who => 'wlang'}, dialect, :parentheses) # => Hello wlang!
|
|
103
|
+
|
|
104
|
+
== Roadmap
|
|
105
|
+
|
|
106
|
+
- For terminology and a quick overview of _wlang_ for generating code, read on.
|
|
107
|
+
- For the current cheatsheet/specification see the file doc/specification/specification.html
|
|
108
|
+
- If you want to learn _wlang_ quickly, see the example directory or read examples
|
|
109
|
+
in the specification file (if you understand all examples in the specification file, then you
|
|
110
|
+
probably master wlang.
|
|
111
|
+
- If you want a killer example (but simple) see the way the specification.html file
|
|
112
|
+
is generated in doc/specification directory
|
|
113
|
+
- If you want to know which dialects are available (that is, in which target languages
|
|
114
|
+
you can generate code), see the specification as well or read the file
|
|
115
|
+
lib/wlang/dialects/standard_dialects.rb in the source distribution.
|
|
116
|
+
- If you want to create your own wlang dialect, see WLang::Dialect::DSL
|
|
117
|
+
- If you think that your own dialect is of generic purpose and well-designed, if
|
|
118
|
+
you have any question or want to contribute join us on {github}[http://github.com/blambeau/wlang].
|
|
119
|
+
|
|
66
120
|
== Terminology
|
|
67
121
|
|
|
68
122
|
_wlang_ comes with a well-defined terminology for the underlying abstractions. As
|
data/bin/wlang
CHANGED
|
@@ -6,11 +6,16 @@
|
|
|
6
6
|
# Copyright (c) 2009 University of Louvain, Bernard & Louis Lambeau
|
|
7
7
|
# Released under a MIT or Ruby licence
|
|
8
8
|
#
|
|
9
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
10
|
+
require 'wlang'
|
|
9
11
|
require 'wlang/wlang_command'
|
|
10
12
|
|
|
11
13
|
begin
|
|
12
14
|
r = WLang::WLangCommand.new
|
|
13
15
|
r.run ARGV
|
|
16
|
+
rescue ::WLang::Error => e
|
|
17
|
+
$stderr.puts e.message
|
|
18
|
+
$stderr.puts e.wlang_backtrace.join("\n\t")
|
|
14
19
|
rescue Interrupt => e
|
|
15
20
|
$stderr.puts
|
|
16
21
|
$stderr.puts "Interrupted"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="dialect">
|
|
2
|
+
<div style="margin-bottom: 20px">
|
|
3
|
+
<h3 style="display: inline">${dialect.qualified_name}</h3>
|
|
4
|
+
?{dialect.ruleset}{
|
|
5
|
+
<p style="display: inline">Includes *{dialect.ruleset.reuse as mod}{${mod.name.match(/::([A-Za-z]+)$/)[1]}}{, }</p>
|
|
6
|
+
}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
?{dialect.dialects}{
|
|
10
|
+
*{dialect.dialects.keys.sort{|k1, k2| k1 <=> k2} as name}{
|
|
11
|
+
<<+{dialect.wtpl with dialect: dialect.dialects[name]}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</div>
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<th class="definition">definition</th>
|
|
5
5
|
<th class="example">example</th>
|
|
6
6
|
</tr>
|
|
7
|
-
*{spec
|
|
7
|
+
*{spec.glossary as t}{
|
|
8
8
|
<tr>
|
|
9
|
-
<td><em>${t
|
|
10
|
-
<td>^{rdoc/nop}{+{t
|
|
11
|
-
<td style="font-size: 90%;">^{rdoc/nop}{+{t
|
|
9
|
+
<td><em>${t.term}</em></td>
|
|
10
|
+
<td>^{rdoc/nop}{+{t.definition}}</td>
|
|
11
|
+
<td style="font-size: 90%;">^{rdoc/nop}{+{t.example}}</td>
|
|
12
12
|
</tr>
|
|
13
13
|
}
|
|
14
14
|
</table>
|
|
@@ -39,25 +39,25 @@ doing so (think at all blocks that expect an expression in the hosting language,
|
|
|
39
39
|
|
|
40
40
|
}}
|
|
41
41
|
<<={examples.rb as examples}
|
|
42
|
-
*{spec
|
|
43
|
-
<h3 id="${ruleset
|
|
44
|
-
^{rdoc/div}{${ruleset
|
|
42
|
+
*{spec.rulesets as ruleset}{
|
|
43
|
+
<h3 id="${ruleset.name}">${ruleset.name}</h3>
|
|
44
|
+
^{rdoc/div}{${ruleset.description}}
|
|
45
45
|
<table class="ruleset">
|
|
46
46
|
<tr>
|
|
47
47
|
<th class="signature">signature</th>
|
|
48
48
|
<th class="name">name</th>
|
|
49
49
|
<th class="definition">definition</th>
|
|
50
50
|
</tr>
|
|
51
|
-
*{ruleset
|
|
51
|
+
*{ruleset.rules as rule}{
|
|
52
52
|
<tr>
|
|
53
|
-
<td class="signature"><tt>${rule
|
|
54
|
-
<td class="name">+{rule
|
|
55
|
-
<td class="definition">^{rdoc/nop}{+{rule
|
|
53
|
+
<td class="signature"><tt>${rule.signature}</tt></td>
|
|
54
|
+
<td class="name">+{rule.name}</td>
|
|
55
|
+
<td class="definition">^{rdoc/nop}{+{rule.definition}}</td>
|
|
56
56
|
</tr>
|
|
57
57
|
}
|
|
58
58
|
</table>
|
|
59
59
|
|
|
60
|
-
?{ruleset
|
|
60
|
+
?{ruleset.examples}{
|
|
61
61
|
<br/>
|
|
62
62
|
<h4>Examples:</h4>
|
|
63
63
|
<table class="examples">
|
|
@@ -66,7 +66,7 @@ doing so (think at all blocks that expect an expression in the hosting language,
|
|
|
66
66
|
<th>wlang expression</th>
|
|
67
67
|
<th>replacement value</th>
|
|
68
68
|
</tr>
|
|
69
|
-
*{ruleset
|
|
69
|
+
*{ruleset.examples as example}{
|
|
70
70
|
<tr>
|
|
71
71
|
<td class="dialect">
|
|
72
72
|
<tt>${example[0]}</tt>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
6
|
-
<title>WLang (version 0.
|
|
6
|
+
<title>WLang (version 0.9.1)</title>
|
|
7
7
|
<style type="text/css">
|
|
8
8
|
body {
|
|
9
9
|
font-family: arial, verdana, sans-serif;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
th.dialect, td.dialect { width: 150px; }
|
|
58
58
|
th.expression, td.expression { width: 350px; }
|
|
59
59
|
th.replacement, td.replacement { width: 350px; }
|
|
60
|
-
|
|
60
|
+
div.dialect {padding-left: 20px;}
|
|
61
61
|
</style>
|
|
62
62
|
<script type="text/javascript" language="JavaScript"><!--
|
|
63
63
|
var current = 'about'
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
//--></script>
|
|
73
73
|
</head>
|
|
74
74
|
<body onload="show('about')">
|
|
75
|
-
<h1 id="title">WLang (version 0.
|
|
75
|
+
<h1 id="title">WLang (version 0.9.1)</h1>
|
|
76
76
|
<ul id="tabs">
|
|
77
77
|
<li id="symbolsfocus" onclick="show('symbols')">Tag symbols</li>
|
|
78
78
|
<li id="glossaryfocus" onclick="show('glossary')">Glossary</li>
|
|
@@ -863,7 +863,7 @@
|
|
|
863
863
|
replacement value.</td>
|
|
864
864
|
</tr>
|
|
865
865
|
<tr>
|
|
866
|
-
<td class="signature"><tt>#={wlang/active-string
|
|
866
|
+
<td class="signature"><tt>#={wlang/active-string}{...}{...}</tt></td>
|
|
867
867
|
<td class="name">block-assignment<br/>(third block is optional)</td>
|
|
868
868
|
<td class="definition"><tt>%={+{@parser.current_dialect} as #1}{#2}{#3}</tt></td>
|
|
869
869
|
</tr>
|
|
@@ -1050,9 +1050,72 @@
|
|
|
1050
1050
|
|
|
1051
1051
|
<div class="clear"></div>
|
|
1052
1052
|
</div>
|
|
1053
|
-
|
|
1053
|
+
<div class="dialect">
|
|
1054
|
+
<div style="margin-bottom: 20px">
|
|
1055
|
+
<h3 style="display: inline">wlang/uri</h3>
|
|
1056
|
+
<p style="display: inline">Includes Basic</p>
|
|
1057
|
+
|
|
1058
|
+
</div>
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
</div>
|
|
1062
|
+
<div class="dialect">
|
|
1063
|
+
<div style="margin-bottom: 20px">
|
|
1064
|
+
<h3 style="display: inline">wlang/sql</h3>
|
|
1065
|
+
<p style="display: inline">Includes Basic, Encoding, Imperative, SQL</p>
|
|
1066
|
+
|
|
1067
|
+
</div>
|
|
1068
|
+
|
|
1069
|
+
<div class="dialect">
|
|
1070
|
+
<div style="margin-bottom: 20px">
|
|
1071
|
+
<h3 style="display: inline">wlang/sql/sybase</h3>
|
|
1072
|
+
<p style="display: inline">Includes Basic, Encoding, Imperative, SQL</p>
|
|
1073
|
+
|
|
1074
|
+
</div>
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
</div>
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
</div>
|
|
1081
|
+
<div class="dialect">
|
|
1082
|
+
<div style="margin-bottom: 20px">
|
|
1083
|
+
<h3 style="display: inline">wlang/active-string</h3>
|
|
1084
|
+
<p style="display: inline">Includes Basic, Imperative</p>
|
|
1085
|
+
|
|
1086
|
+
</div>
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
</div>
|
|
1090
|
+
<div class="dialect">
|
|
1091
|
+
<div style="margin-bottom: 20px">
|
|
1092
|
+
<h3 style="display: inline">wlang/xhtml</h3>
|
|
1093
|
+
<p style="display: inline">Includes Basic, Encoding, Imperative, Buffering, Context, XHtml</p>
|
|
1094
|
+
|
|
1095
|
+
</div>
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
</div>
|
|
1099
|
+
<div class="dialect">
|
|
1100
|
+
<div style="margin-bottom: 20px">
|
|
1101
|
+
<h3 style="display: inline">wlang/ruby</h3>
|
|
1102
|
+
<p style="display: inline">Includes Basic, Encoding, Imperative, Context, Ruby</p>
|
|
1054
1103
|
|
|
1055
1104
|
</div>
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
</div>
|
|
1108
|
+
<div class="dialect">
|
|
1109
|
+
<div style="margin-bottom: 20px">
|
|
1110
|
+
<h3 style="display: inline">wlang/dummy</h3>
|
|
1111
|
+
|
|
1112
|
+
</div>
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
</div>
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
</div>
|
|
1056
1119
|
<div id="hosting" style="display: none;">
|
|
1057
1120
|
<div class="header">
|
|
1058
1121
|
<h2>Hosting language</h2>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
6
|
-
<title>${spec
|
|
6
|
+
<title>${spec.title} (version ${spec.version})</title>
|
|
7
7
|
<style type="text/css">
|
|
8
8
|
<<{specification.css}
|
|
9
9
|
</style>
|
|
@@ -12,28 +12,28 @@
|
|
|
12
12
|
//--></script>
|
|
13
13
|
</head>
|
|
14
14
|
<body onload="show('about')">
|
|
15
|
-
<h1 id="title">${spec
|
|
15
|
+
<h1 id="title">${spec.title} (version ${spec.version})</h1>
|
|
16
16
|
<ul id="tabs">
|
|
17
|
-
*{spec
|
|
18
|
-
<li id="+{section
|
|
17
|
+
*{spec.sections.reverse as section}{
|
|
18
|
+
<li id="+{section.identifier}focus" onclick="show('{section.identifier}')">${section.name}</li>
|
|
19
19
|
}
|
|
20
20
|
</ul>
|
|
21
21
|
<div class="clear"></div>
|
|
22
|
-
*{spec
|
|
23
|
-
<div id="{section
|
|
22
|
+
*{spec.sections as section}{
|
|
23
|
+
<div id="{section.identifier}" style="display: none;">
|
|
24
24
|
<div class="header">
|
|
25
|
-
<h2>${section
|
|
26
|
-
?{section
|
|
25
|
+
<h2>${section.name}</h2>
|
|
26
|
+
?{section.links}{
|
|
27
27
|
<ul class="links">
|
|
28
|
-
*{+{section
|
|
28
|
+
*{+{section.links} as link}{<li><a href="#${link.name}">${link.name}</a></li>}
|
|
29
29
|
</ul>
|
|
30
30
|
}
|
|
31
31
|
<div class="clear"></div>
|
|
32
32
|
</div>
|
|
33
|
-
?{/rdoc$/ =~ "{section
|
|
34
|
-
^{rdoc/div}{<<{+{section
|
|
33
|
+
?{/rdoc$/ =~ "{section.file}"}{
|
|
34
|
+
^{rdoc/div}{<<{+{section.file}}}
|
|
35
35
|
}{
|
|
36
|
-
<<+{+{section
|
|
36
|
+
<<+{+{section.file} with spec: spec}
|
|
37
37
|
}
|
|
38
38
|
</div>
|
|
39
39
|
}
|