summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6bf80b7)
Spaces are now allowed in (decimal) numbers to highlight
grouping.
Tests are added.
Also ensure unknown marks are reported as errors.
Signed-off-by: NeilBrown <neil@brown.name>
###### test: consts
const:
###### test: consts
const:
four ::= 2 + 2 ; five ::= 10/2
const pie ::= "I like Pie";
cake ::= "The cake is"
four ::= 2 + 2 ; five ::= 10/2
const pie ::= "I like Pie";
cake ::= "The cake is"
program:
size::=55
list:[size]number
program:
size::=55
list:[size]number
for i:=1; then i = i + 1; while i < size:
n := list[i-1] * list[i-1]
list[i] = (n / 100) % 10000
for i:=1; then i = i + 1; while i < size:
n := list[i-1] * list[i-1]
list[i] = (n / 100) % 10000
struct parse_context context = {
.config = {
.ignored = (1 << TK_line_comment)
struct parse_context context = {
.config = {
.ignored = (1 << TK_line_comment)
- | (1 << TK_block_comment),
- .number_chars = ".,_+-",
+ | (1 << TK_block_comment)
+ | (1 << TK_mark),
+ .number_chars = ".,_+- ",
.word_start = "_",
.word_cont = "_",
},
.word_start = "_",
.word_cont = "_",
},
###### demo: hello
const:
###### demo: hello
const:
four ::= 2 + 2 ; five ::= 10/2
const pie ::= "I like Pie";
cake ::= "The cake is"
four ::= 2 + 2 ; five ::= 10/2
const pie ::= "I like Pie";
cake ::= "The cake is"
// Dad taught me - the first one I ever heard of.
for i:=1; then i = i + 1; while i < size:
n := list[i-1] * list[i-1]
// Dad taught me - the first one I ever heard of.
for i:=1; then i = i + 1; while i < size:
n := list[i-1] * list[i-1]
- list[i] = (n / 100) % 10000
+ list[i] = (n / 100) % 10 000
print "Before sort:",
for i:=0; then i = i + 1; while i < size:
print "Before sort:",
for i:=0; then i = i + 1; while i < size: