main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[79a0317] | 1 | var helpers = require('./helpers');
|
---|
| 2 |
|
---|
| 3 | function store(serializeContext, token) {
|
---|
| 4 | serializeContext.output.push(typeof token == 'string' ? token : token[1]);
|
---|
| 5 | }
|
---|
| 6 |
|
---|
| 7 | function context() {
|
---|
| 8 | var newContext = {
|
---|
| 9 | output: [],
|
---|
| 10 | store: store
|
---|
| 11 | };
|
---|
| 12 |
|
---|
| 13 | return newContext;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | function all(tokens) {
|
---|
| 17 | var oneTimeContext = context();
|
---|
| 18 | helpers.all(oneTimeContext, tokens);
|
---|
| 19 | return oneTimeContext.output.join('');
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | function body(tokens) {
|
---|
| 23 | var oneTimeContext = context();
|
---|
| 24 | helpers.body(oneTimeContext, tokens);
|
---|
| 25 | return oneTimeContext.output.join('');
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | function property(tokens, position) {
|
---|
| 29 | var oneTimeContext = context();
|
---|
| 30 | helpers.property(oneTimeContext, tokens, position, true);
|
---|
| 31 | return oneTimeContext.output.join('');
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | function rules(tokens) {
|
---|
| 35 | var oneTimeContext = context();
|
---|
| 36 | helpers.rules(oneTimeContext, tokens);
|
---|
| 37 | return oneTimeContext.output.join('');
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | function value(tokens) {
|
---|
| 41 | var oneTimeContext = context();
|
---|
| 42 | helpers.value(oneTimeContext, tokens);
|
---|
| 43 | return oneTimeContext.output.join('');
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | module.exports = {
|
---|
| 47 | all: all,
|
---|
| 48 | body: body,
|
---|
| 49 | property: property,
|
---|
| 50 | rules: rules,
|
---|
| 51 | value: value
|
---|
| 52 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.