Miguel Lechon
537b962b2b
[docs] Misc fixes.
2021-11-01 17:24:21 +01:00
Miguel Lechon
47613b5563
[expr parser] Communicate expression operator table bake errors through callback.
2021-10-24 17:11:28 +02:00
Miguel Lechon
343b239fa1
[expr parser] Reject multitoken and non-symbol, non-id token operators (note 3).
2021-10-06 08:02:46 +02:00
Miguel Lechon
88bf5be37c
[expr parser] Postfix (),[],{},[),(] behave the same (note 2).
2021-10-04 20:18:46 +02:00
Miguel Lechon
94cd3ced02
[expr parser] Disallow non-postfix set-like operators (note 1b).
2021-10-04 07:57:45 +02:00
Miguel Lechon
d1745050dd
[expr parser] Treat all sets as leaves (note 1a).
2021-10-03 18:38:13 +02:00
Miguel Lechon
b83546a60a
[expr parser] More tests.
2021-09-12 19:55:14 +02:00
Miguel Lechon
9cc8f80abe
[expr parser] Column information on parse errors.
2021-09-12 14:05:39 +02:00
Miguel Lechon
4f4fb0f7f9
[expr parser] Move acceleration into parse context.
2021-09-12 11:12:26 +02:00
Miguel Lechon
aad96bf978
[expr parser] Detect premature end of expression.
2021-09-11 11:21:34 +02:00
Miguel Lechon
b2c901d60f
[expr parser] Brace/bracket unary op required for set leaves.
2021-09-09 12:48:04 +02:00
Miguel Lechon
c0a50bfe27
Discard and warn against conflicting expression operators.
2021-09-09 12:21:03 +02:00
Miguel Lechon
c6c790e50d
expression parser; first pass.
2021-09-07 18:16:57 +02:00
Miguel Lechon
c0a56dbcda
tweak expression parser interface.
2021-09-03 13:12:06 +02:00
miguel.lechon
90073dc802
Test node text flags independently.
2021-07-04 12:11:49 +02:00
miguel.lechon
6e6512b09d
Remove outdated grammar test.
2021-07-04 11:53:00 +02:00
Miguel Lechon
0945c9c71e
[namespaces] Type versioning sample.
2021-03-29 17:57:38 +02:00
Miguel Lechon
c38bc6de30
[namespaces] Build namespaces as lists of reference nodes.
2021-03-29 17:51:36 +02:00
Miguel Lechon
230fd4043c
Improve location of MD_Error.
2021-03-27 18:14:17 +01:00
Miguel Lechon
6478fb24c1
Error for MD_ParseWholeFile of missing file.
2021-03-27 15:47:54 +01:00
Miguel Lechon
8ab96ecaea
Simpler MD_Error.
...
The catastrophic error flag is now subsumed under MD_MessageKind.
The filename member is accessible through the compulsory node pointer.
2021-03-23 11:44:37 +01:00
Miguel Lechon
20f85761c7
[map] Expose PtrMap on md.h. Remove NodeTable defines.
2021-03-22 15:45:36 +01:00
Miguel Lechon
7a06b11f49
Remove catastrophic from MD_Error and add MD_MessageKind to it.
2021-03-18 18:24:41 +01:00
Miguel Lechon
eef82b0554
Pipe error location through error->node.
2021-03-18 17:40:06 +01:00
Miguel Lechon
f4965c782d
Multi-line string escaping.
2021-03-18 12:28:16 +01:00
Miguel Lechon
96c3c46531
fopen with "wb" to avoid mixed LF/CRLF output on windows.
2021-03-18 10:12:55 +01:00
Miguel Lechon
6026c3639d
Remove MD_Map aliases.
2021-03-16 19:15:48 +01:00
Miguel Lechon
541a5443b6
Test and avoid MD_StringMap collisions.
2021-03-16 19:05:48 +01:00
Miguel Lechon
55943b79fc
Move map into md.h asn md_impl.c.
2021-03-16 11:28:41 +01:00
Miguel Lechon
7645afbcc1
[grammar test] Store production depth on MD_PtrMap.
2021-03-16 11:20:18 +01:00
Miguel Lechon
fed011fc52
Switch to map_proposal.
2021-03-16 11:11:13 +01:00
Miguel Lechon
d5ab0e88df
Rename MD_TokenKind_NonASCII to MD_TokenKind_BadCharacter.
2021-03-16 09:46:53 +01:00
Miguel Lechon
eb0cf0c9bf
MD_Node->at fix.
...
node->at now points to the first relevant character in the source .md file.
For namespaces and tags that is the first character of the identifier
(not the '#'/'@' symbols).
For labels it's the first character in node->whole_string if non-empty.
For unlabeled sets it's the opening '(', '[' or '{' character.
2021-03-16 09:19:02 +01:00
Miguel Lechon
084d55d55d
Report and skip non-ASCII characters.
2021-03-14 12:12:30 +01:00
Miguel Lechon
e3357f0759
Syntax error sanity tests.
2021-03-14 11:24:26 +01:00
Miguel Lechon
e4fbe7a81d
More parsing errors.
...
Invalid hash directives.
Invalid tag token.
Reserved characters.
2021-03-13 10:01:08 +01:00
Miguel Lechon
2829d0923b
Report parse errors preceding catastrophic error.
2021-03-12 16:12:00 +01:00
Miguel Lechon
34c48c84ff
Parsing error for "label:@tag{children}".
2021-03-11 21:08:38 +01:00
Miguel Lechon
72b7e3b366
And syntax error tests.
2021-03-11 17:15:22 +01:00
Miguel Lechon
e25c5a66c2
Parsing errors for unterminated C-Style comments.
2021-03-11 17:13:02 +01:00
Miguel Lechon
e2cefabe5c
Finetune error locations.
2021-03-11 16:08:13 +01:00
Miguel Lechon
701b77e118
Parsing errors for unbalanced sets and text literals.
2021-03-10 18:32:29 +01:00
Miguel Lechon
35ef98a5fd
Sync build scripts.
2021-03-09 18:12:34 +01:00
Miguel Lechon
2d22fc17d5
[grammar test] Remove malformed tagging. Give up on comments.
2021-03-08 20:02:27 +01:00
Miguel Lechon
bf9bfae929
comment_after fix.
2021-03-05 10:35:40 +01:00
Miguel Lechon
493f4239d5
[grammar test] Cleaner grammar.
2021-03-05 09:51:26 +01:00
Miguel Lechon
61f9149a2b
[grammar test] before_comment.
2021-03-04 15:21:55 +01:00
Miguel Lechon
b72890d44e
before_comment fix.
...
When two or more comments are followed by a node, use the closest
comment as the before_comment. Prior to the fix, this combination
left node unbefore_commented:
// comment1 \n // comment2 \n node
2021-03-04 15:18:42 +01:00
Miguel Lechon
e7dfe525c5
Radix for MD_I64FromString.
2021-03-03 13:14:56 +01:00
Miguel Lechon
0c6df62acd
Hash map proposal.
2021-03-01 18:35:02 +01:00
Miguel Lechon
4a4f4db91a
Make , and ; behave like \n as unscoped set delimiters.
2021-02-25 20:03:22 +01:00
Miguel Lechon
37fefae283
Treat the inside of a file as the content of a set.
2021-02-24 12:18:47 +01:00
Miguel Lechon
71d5235f81
[grammar test] Fairly complete test grammars.
2021-02-22 14:55:39 +01:00
Miguel Lechon
1304086266
Escape `` strings. Allow leading underscores in identifiers.
2021-02-22 14:53:23 +01:00
Miguel Lechon
de104364b6
[grammar test] Some incomplete test grammars.
2021-02-21 19:13:16 +01:00
Miguel Lechon
a2066a0c58
[grammar test] Limit the depth of generated tests.
2021-02-21 19:12:30 +01:00
Miguel Lechon
ee4989f6e3
Enforce lack of whitespace between a tag and its arguments.
...
This makes constructs such as "@a (1, 2)" behave like "@a {1, 2}",
where @a tags the set (1, 2).
2021-02-21 18:58:33 +01:00
Miguel Lechon
5d5b4e730c
Don't consume implicit newline delimiters.
...
Newlines should act as implicit delimiters for more than one nested set
in the absence of explicit delimiters.
For instance in "A:B:C\nD" the newline makes D a sibling of A.
2021-02-21 18:36:59 +01:00
Miguel Lechon
c5d88b890b
[grammar test] Extra set delimiters and separators.
...
Delimiters: Square brackets and parentheses.
Separators: Commas and semicolons
2021-02-17 12:05:56 +01:00
Miguel Lechon
35c802deae
[grammar test] Sort tests by increading complexity.
2021-02-17 08:13:24 +01:00
Miguel Lechon
50d6f7cd64
[grammar test] Labeled nodes and tag parameters.
2021-02-16 19:35:24 +01:00
Miguel Lechon
e2920e565b
Partial MD grammar test.
2021-02-13 19:57:59 +01:00
Miguel Lechon
a0df1e32d2
Minimal escaping rules for character and string literals.
2021-02-13 18:50:09 +01:00
Miguel Lechon
4e8bfbee03
MD_ZERO_STRUCT instead of {0}.
2021-02-11 11:49:49 +01:00
Miguel Lechon
aeb3f6e224
Avoid misinterpreting closing symbols inside literals.
2021-02-09 18:37:50 +01:00
Miguel Lechon
d96d76f167
Linux-specific directory listing.
2021-01-31 09:09:53 +01:00
Miguel Lechon
8a09a5c315
Avoid fopen newline processing.
2021-01-26 07:23:26 +01:00
Miguel Lechon
957996c6fa
Add C code generation example to clang and linux build scripts.
2021-01-26 06:48:53 +01:00
Miguel Lechon
4d2565b3f3
POSIX directory listing.
2021-01-21 20:09:11 +01:00
Miguel Lechon
5ff1c5e0a5
Windows/Linux clang build scripts.
2021-01-21 18:08:03 +01:00
Miguel Lechon
1d9f236daf
Tweaks to make clang happy.
2021-01-21 18:03:24 +01:00