Max Brunsfeld
9c37c06ec7
Remove unnecessary parser debugger accessors
2016-07-04 12:20:23 -07:00
Max Brunsfeld
abbc282950
Add a public function for printing debugging graphs
2016-02-23 11:16:50 -08:00
Max Brunsfeld
3d7df851b5
Rename Vector -> Array
2016-02-17 20:41:29 -08:00
Max Brunsfeld
3f08bfb264
Fix build warnings
2016-02-12 14:11:11 -08:00
Max Brunsfeld
c96c4a08e6
Use an object pool for stack nodes, to reduce allocations
...
Also, fix some leaks in the case where memory allocation failed during parsing
2016-02-04 11:19:42 -08:00
Max Brunsfeld
a74bf7ece1
Release tree when changing document's language
2016-01-29 17:25:07 -08:00
Max Brunsfeld
95828f42a8
Fix leak of StringInput wrapper struct
2016-01-29 16:40:38 -08:00
Max Brunsfeld
3dde0a6f39
Handle allocation failures during parsing
2016-01-19 18:08:01 -08:00
Max Brunsfeld
1543a6c7b0
Handle allocation failures when instantiating documents
2016-01-18 11:32:10 -08:00
Max Brunsfeld
87316f22f3
Wrap all calls to malloc and friends
2016-01-15 15:27:50 -08:00
Max Brunsfeld
da1bc038e5
Remove nested options structs in Tree
2015-12-22 14:20:58 -08:00
Max Brunsfeld
d2bf88d5fe
Include rows and columns in TSLength
...
This way, we don't have to have separate 1D and 2D versions for so many values
2015-12-04 20:20:29 -08:00
Max Brunsfeld
22c76fc71b
Remove TSLength from runtime header
...
Refactor node functions now that character offset and byte offset are stored separately
2015-12-04 10:45:30 -08:00
joshvera
2dc63f2c30
Revert "start the root node from 1"
...
This reverts commit 7fab9e2c42 .
2015-11-30 12:16:49 -05:00
joshvera
7fab9e2c42
start the root node from 1
2015-11-25 14:28:52 -05:00
joshvera
3d9a44d880
Calculate the column and offset separately in TSNode
2015-11-25 13:36:19 -05:00
joshvera
b0f6bac3ab
replace start and end with padding and size
2015-11-18 16:34:50 -08:00
Max Brunsfeld
0955f660d0
Add ts_document_invalidate, for forcing a full re-parse
2015-10-18 13:05:40 -07:00
Max Brunsfeld
216ce8c80b
Rename receiver parameter to 'self'
2015-10-14 22:14:08 -07:00
Max Brunsfeld
aba8af9e5b
Cleanup debug logging in parser
2015-09-22 19:35:13 -07:00
Max Brunsfeld
7be067a2e9
Guard for null tree in ts_document_edit
2015-09-20 13:39:18 -07:00
Max Brunsfeld
f37f73f92f
Add ability to edit multiple times between parses
2015-09-18 23:20:06 -07:00
Max Brunsfeld
b3d883e128
Store edits in trees, not by splitting stack
...
This allows for multiple edits per parse, though it is not exposed through
the API yet
2015-09-18 22:02:06 -07:00
Max Brunsfeld
296d8cc1e8
clang-format
2015-09-13 19:41:11 -07:00
Max Brunsfeld
66ad271c82
Add Document parse_count() method, for tracking if trees are still valid
2015-09-10 14:23:42 -07:00
Max Brunsfeld
252fa7b631
Add Document getter methods for input, language
2015-09-08 23:33:43 -07:00
Max Brunsfeld
ebd60213d9
Drop release functions from callback structs
...
The caller can just as easily take care of the cleanup explicitly
2015-09-08 23:24:33 -07:00
Max Brunsfeld
7ee5eaa16a
Rename node accessor methods
...
Instead of child() vs concrete_child(), next_sibling() vs next_concrete_sibling(), etc,
the default is switched: child() refers to the concrete syntax tree, and named_child()
refers to the AST. Because the AST is abstract through exclusion of some nodes, the
names are clearer if the qualifier goes on the AST operations
2015-09-08 23:16:24 -07:00
Max Brunsfeld
53926c467e
Don't automatically hide singleton nodes
2015-09-02 16:36:29 -07:00
Max Brunsfeld
21258e6a9e
Remove 'document' wrapper node
2015-08-22 10:48:34 -07:00
Max Brunsfeld
6933d7b425
🎨 naming conventions
2015-08-16 20:05:47 -07:00
Max Brunsfeld
3e17172f6e
Remove unnecessary conditional
2015-08-16 10:54:02 -07:00
Max Brunsfeld
8a9626bfc5
Simplify storage of position on nodes
2015-08-14 14:48:29 -07:00
Max Brunsfeld
54e40b8146
Rework AST access API: reduce heap allocation
2015-07-31 15:47:48 -07:00
Max Brunsfeld
f9b057f3a9
clang-format everything
2015-07-27 18:29:48 -07:00
Max Brunsfeld
8cf800ef5d
Unify debugging API for parsing and lexing
2014-10-17 17:52:54 -07:00
Max Brunsfeld
c594208ab8
Allow callbacks to be specified for debug output
2014-10-13 01:02:18 -07:00
Max Brunsfeld
e23f11b7c4
Allow lexical debug mode to be enabled on documents
...
- `ts_document_set_debug(doc, 1)` implies parse debug mode
- `ts_document_set_debug(doc, > 1)` implies parse and lex debug mode
2014-09-11 13:12:06 -07:00
Max Brunsfeld
2e7ffb4d14
Tweak auto-format settings
...
Prefer lines that exceed 80 characters by a small margin to
line breaks in argument lists
2014-09-09 13:15:40 -07:00
Max Brunsfeld
43ecac2a1d
Expose debug flag on document
2014-09-06 17:56:00 -07:00
Max Brunsfeld
0193be166b
Fix overridden initializer warning in tree constructor
2014-08-27 22:06:27 -07:00
Max Brunsfeld
9db291fe88
Fix missing initializer warning in document constructor
2014-08-27 21:45:46 -07:00
Max Brunsfeld
4327f3ed26
Refactor parser and stack
2014-08-09 01:03:55 -07:00
Max Brunsfeld
8da9219c3a
Remove redundant functions for Documents
...
There's no need for a `string` function since one already
exists for Nodes.
Now the root node is always stored on the document. This
means callers of `ts_document_root_node` don't need to release
its return value.
2014-08-08 12:58:51 -07:00
Max Brunsfeld
03a5a97992
Move StringInput into its own file
2014-08-01 12:43:14 -07:00
Max Brunsfeld
41d26aaceb
Fix segfault when document's input is set before its language
2014-08-01 12:34:49 -07:00
Max Brunsfeld
412cc93812
clang format
2014-07-31 13:11:39 -07:00
Max Brunsfeld
eecbcccee0
Remove generated parsers' dependency on the runtime library
...
Generated parsers no longer export a parser constructor function.
They now export an opaque Language object which can be set on
Documents directly. This way, the logic for constructing parsers
lives entirely in the runtime. The Languages are just structs which
have no load-time dependency on the runtime
2014-07-30 23:40:02 -07:00
Max Brunsfeld
048a479b5f
Fix missing initializer warning in gcc
2014-07-29 13:04:19 -07:00
Max Brunsfeld
98cc2f2264
Auto-format all source code with clang-format
2014-07-21 13:20:00 -07:00