Skip to content

Telo v0.115.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 15:55
e4e9203

Packages

Package Version
@telorun/cli 0.115.0
@telorun/analyzer 0.115.0
@telorun/cel 0.115.0
@telorun/ide-support 0.115.0
@telorun/kernel 0.115.0
@telorun/language-server 0.115.0
@telorun/sdk 0.115.0
@telorun/templating 0.115.0

Minor

The CEL reader and writer answer more precisely where a source cannot be read, and refuse four forms that used to read clean. An expression that read before and is refused now is one of: .true / .false / .null, a member named by an empty pair of backticks, a raw single-line literal running across a backslash and a line feed, or an expression taller than the depth limit. — cel

  • The first diagnostic is the first in source order, and the tree keeps everything before it. Text no token can be read from (an open quote, a stray character) no longer discards the expression read so far: the tree is exactly the tree of the source cut where that text begins, so 1 + 2 + 'abc is (1 + 2) + <unparsed> with unterminated_string at [8,12). When the part before the cut is itself unreadable, its diagnostic is the one reported () + 'abc reports the parenthesis); a tie goes to the unreadable text. Still at most one diagnostic.
  • .true, .false and .null are refused as .while is: reserved_identifier, "true" is a reserved word and cannot be used as a name, ranged over the word. a.true still reads — a member name is any word.
  • An empty quoted member is refused: a. reports `unexpected_token`,"" cannot stand here, expected "a name between the backticks", over the two backticks, and leaves the select with an empty, unquoted field that an unnamed member already leaves.
  • maxDepth bounds the height of the tree as well as the nesting of the grammar. A node with no child is 1 high, any other one more than its tallest child; the node past the limit is kept and reported as limit_exceeded, the expression has more nesting than the limit of 250, ranged over it. So a chain is nesting: 1+1+… reads with 250 operands and is refused at 251, a.b.b… reads with 249 members and is refused at 250. A tree read with no diagnostic is at most maxDepth high, which is what every recursive walker downstream relies on.
  • A single-line raw literal ends at a line feed even after a backslash: r'a\<LF>b' is unterminated_string over [1,4). A backslash still takes any other character, and a triple-quoted raw literal is unchanged.
  • Every diagnostic range lies within the source and splits no character. A character outside the basic plane is named whole and ranged over its two code units, both where no token can stand (unexpected character "😀", [0,2)) and after a backslash (\😀 is not an escape sequence, the backslash and both units). An escape short of its digits is ranged as written — "\x is [1,3), '\x4' is [1,4) — instead of by the width it should have had, which could end past the source.
  • The writer parenthesizes the number a negated chain begins with. -(1).a, -(1)[0] and -(1).f() are written as such; before, they were written -1.a, -1[0], -1.f(), which read back as a member of -1. Every source that reads with no diagnostic now writes and reads back to an equal tree under the options it was read with, with no exception.

Verify: parseSyntax("1 + 2 + 'abc") answers a binary tree and one diagnostic at offset 8; parseSyntax(".true"), parseSyntax("a.")`` and a sum of 251 operands each answer one diagnostic; serializeTree(parseSyntax("-(1).a").root) is `-(1).a`.


Changelogs: cli · analyzer · cel · ide-support · kernel · language-server · sdk · templating