mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Length, string -> std functions
This commit is contained in:
parent
216e716251
commit
f1430a1cdf
10 changed files with 21 additions and 39 deletions
|
|
@ -6,7 +6,7 @@ var
|
|||
lident = createRegexp ("[a-z][a-zA-Z_]*", "lowercase identifier"),
|
||||
uident = createRegexp ("[A-Z][a-zA-Z_]*", "uppercase identifier"),
|
||||
ws = createRegexp ("\\([ \t\n]\\|--[^\n]*\n\\)*", "whitespace"),
|
||||
str = createRegexp ("""\([^""]\|""""\)*""", "string literal"),
|
||||
strlit = createRegexp ("""\([^""]\|""""\)*""", "string literal"),
|
||||
decimal = createRegexp ("[0-9]+", "decimal literal"),
|
||||
chr = createRegexp ("'[^']'", "character literal");
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ fun collect_ints_acc (v, tail) {
|
|||
var i;
|
||||
|
||||
case v of
|
||||
a@#val -> Cons (a, tail)
|
||||
| #string -> tail
|
||||
a@#val -> Cons (a, tail)
|
||||
| #str -> tail
|
||||
| _ ->
|
||||
for i := 0, i < v.length, i := i + 1 do
|
||||
tail := collect_ints_acc (v[i], tail)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue