summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton L. Šijanec <anton@sijanec.eu>2020-05-02 00:47:52 +0200
committerAnton L. Šijanec <anton@sijanec.eu>2020-05-02 00:47:52 +0200
commit660e20b37d46da72b4e253360998cb7fa7d5630b (patch)
treeabc1d8ae2e1461ebb2ce28b38327184a7d7ed818
parentcommand detection made possible (diff)
downloadbverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar
bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.gz
bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.bz2
bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.lz
bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.xz
bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.tar.zst
bverbose-660e20b37d46da72b4e253360998cb7fa7d5630b.zip
Diffstat (limited to '')
-rw-r--r--README.md9
-rwxr-xr-xa.outbin12288 -> 12252 bytes
-rw-r--r--src/tape.c12
-rw-r--r--test/tape-test.bvr3
-rw-r--r--tmp/output.htm7
5 files changed, 23 insertions, 8 deletions
diff --git a/README.md b/README.md
index 75c537a..cd334ee 100644
--- a/README.md
+++ b/README.md
@@ -43,3 +43,12 @@ bVerbose
└── tmp (temp folder of bVerbose, used whilst compiling bvr into HTML)
```
+# language syntax
+
+<@enter command string here@>
+
+commands are characters, such as `s` for `set`, `g` for `get` and `i` for `include`.
+
+commands are prefixed with `?` --- question marks.
+
+commands are followed by their arguments.
diff --git a/a.out b/a.out
index 9272867..ce1f0da 100755
--- a/a.out
+++ b/a.out
Binary files differ
diff --git a/src/tape.c b/src/tape.c
index 846b96a..42d736d 100644
--- a/src/tape.c
+++ b/src/tape.c
@@ -64,14 +64,16 @@ int bvr_inline_command_processor(FILE * page_source_file, FILE * temp_output_fil
}
if(copy_buffer[(ftell(page_source_file)-1)% COPY_BUFFER_SIZE] == CLOSING_COMMAND_TAG_CHAR_1 &&
copy_buffer[ftell(page_source_file)% COPY_BUFFER_SIZE] == CLOSING_COMMAND_TAG_CHAR_2) { // end of arguments!
+ /// char argument_string[argument_length+1];
+ /// strncpy(argument_string, copy_buffer+(ftell(page_source_file)-(argument_length-1))% COPY_BUFFER_SIZE, argument_length);
+ copy_buffer[(ftell(page_source_file)-1)% COPY_BUFFER_SIZE] = '\0';
+ /// argument_string[argument_length-2] = '\0';
+ printf("end of command, command was %c, argument was %s\n", copy_buffer[(ftell(page_source_file)-(1+argument_length))% COPY_BUFFER_SIZE],
+ /// argument_string);
+ copy_buffer+(ftell(page_source_file)-(argument_length-1))% COPY_BUFFER_SIZE);
// switch (copy_buffer[(ftell(page_source_file)-(1+argument_length))]) { // switch command
//
// }
- char argument_string[argument_length+1];
- strncpy(argument_string, copy_buffer+(ftell(page_source_file)-(argument_length-1)), argument_length);
- argument_string[argument_length-2] = '\0';
- printf("end of command, command was %c, argument was \"%s\"\n", copy_buffer[(ftell(page_source_file)-(1+argument_length))], argument_string);
- fprintf(temp_output_file, "command was %c, argument was \"%s\"\n", copy_buffer[(ftell(page_source_file)-(1+argument_length))], argument_string);
return SUCCESS;
}
}
diff --git a/test/tape-test.bvr b/test/tape-test.bvr
index bcbee24..c965bc1 100644
--- a/test/tape-test.bvr
+++ b/test/tape-test.bvr
@@ -2,5 +2,6 @@
# to je komentar in se ne rendera
<@?i h1@>
<@?s image_caption This is an example image.@>
-<@?s image_src example.jpg@>
+<@?s example.jpg@>
<@?i image@>
+in tako so srečno živeli do konca svojih dni!
diff --git a/tmp/output.htm b/tmp/output.htm
index b412afb..7dece8a 100644
--- a/tmp/output.htm
+++ b/tmp/output.htm
@@ -1,2 +1,5 @@
-<h1>command was s, argument was "should be"
-></h1>
+>>
+>
+>
+>
+in tako so srečno živeli do konca svojih dni!