Commit Graph

23 Commits

Author SHA1 Message Date
Scott Olsen
b3ae93bfc4
fix: ensure registered types with fields emit path (#1364)
This fixes an issue where by types with fields registered in modules
weren't emitted with their module paths. This makes the behavior between
RegisterTypeWithoutFields and RegisterTypeWithFields the same. They both
account for the current module path in which the type is registered and
output the emitted typedef appropriately.

This fix also eliminates the need for a workaround in core/Pattern.carp.
We previously had to register MatchResult with an override because of
the old behavior, but now the override is no longer needed (since
MatchResult is defined as PatternMatchResult in its source header).  The
call (register MatchResult) within (defmodule Pattern) emits
"PatternMatchResult" by default since we now account for module paths
for registered types.
2021-12-16 21:31:16 +01:00
Veit Heller
d3a6ca562f
docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
guberathome
e412559380
reorganize Pattern library (#1257)
* feat!: implemented Pattern.match which returns start and end indizes of the first match

* fix: Pattern.match now returns correct end index

* feat: moved Pattern.match-str and Pattern.find from C to Carp code

* chore: fix build after merges

* chore: fix build after merges

* feat: moved Pattern.find-all from C to Carp code

* feat: Pattern.global-match-str no longer relies on Pattern.global-match

* docs: updated for Pattern.global-match

* fix: moved str/prn functions into sub module

* fix: removed unused functions from carp_pattern.h (using cflow)

* feat!: renamed (Pattern.global-match) to (Pattern.match-all-groups)

* fix: unit test

* fix: some functions renamed to match Carp style

Co-authored-by: guberatsie <gunnar.bernhardt@siemens.com>
2021-06-23 22:07:56 +02:00
Veit Heller
77020df042
fix: fix String.words for multiple spaces (#1205) 2021-04-23 09:35:34 +02:00
Erik Svedäng
6f7aeaff73
feat: 'delete' interface (deciding whether a type is managed or not) (#1061)
* feat: 'delete' interface (deciding whether a type is managed or not)

* refactor: Move implements function to Interface module

* feat: Automatically implement 'delete' for types defined with `deftype`

* fix: Don't implement `delete` for Pointer

* refactor: Clarify `memberInfo` function

* fix: Also check if function types are managed

* fix: Implement 'delete' for String and StaticArray.

* fix: Manage String and Pattern. Tests run!

* feat: Add `managed?` primitive

* docs: Note about primitiveIsManaged

* test: Basic test cases for managed / nonmanaged external types

* test: Make sure `managed?` primitive works

* test: Inactivate sanitizer since we're creating leaks intentionally

* feat: Removed 'isExternalType' function

* refactor: Decide if struct member takes ref or not when printing

..based on blitable interface, and 'prn' implemntation

* refactor: Use 'blit' everywhere

* refactor: Implement `strTakesRefOrNot` in terms of `memberStrCallingConvention`

* refactor: Use `remove` over `filter not`
2020-12-20 21:21:14 +01:00
rrruko
e3af878e2a
Return reference from unsafe-first/unsafe-last (#1027)
* core: return Array.unsafe-first as reference (#970)

* core: return Array.unsafe-last as reference (#970)

* Make examples and tests build
2020-11-27 10:19:06 +01:00
Erik Svedäng
aae743fb35
Merge pull request #769 from scolsen/implement-prim
Add an `implements` primitive, update core
2020-05-12 21:45:29 +02:00
Scott Olsen
f13a2fdd9d Add some more calls to implement to make tests pass 2020-05-10 13:32:22 -04:00
hellerve
57be1e7f4e core: mention backreferences in substitute docs 2020-05-10 12:20:26 +02:00
hellerve
ee812b37e6 core: make subarry/substring slice 2020-02-11 09:09:30 +01:00
hellerve
66431a4c80 pattern: fix captures, add split and global-match-str 2020-02-09 13:42:39 +01:00
GrayJack
07def7db23 Fix all nth usage 2019-10-31 06:23:23 -03:00
hellerve
113aa1d96a core: also split by newline in String.words 2019-05-24 15:39:52 +02:00
hellerve
ffa8302e1e core: better Pattern docs 2019-05-04 09:41:33 +02:00
Erik Svedäng
cd96ccbf39 Tests run again. 2018-11-14 21:21:56 +01:00
hellerve
a451a78f73 core: add Pattern.find-all and optimize String.split-by 2018-11-01 16:20:52 +01:00
hellerve
c82916612a core: document string, remove string-join 2018-06-15 16:38:34 +02:00
hellerve
db0a3d4417 core: document integer, interfaces, pattern, safeint, and system 2018-05-12 16:08:48 +02:00
Erik Svedäng
32eaae7a5c Pretty nice looking docs. 2018-03-27 09:05:58 +02:00
hellerve
ef5d50cad8 core: add Pattern.from-chars, simplify String.split-by 2018-03-13 17:06:14 +01:00
hellerve
da91127563 core: add useful string functions 2018-03-13 12:13:29 +01:00
hellerve
dac3bad33a core: regex helper functions are done 2018-03-03 19:19:59 +01:00
hellerve
5c736fd224 core: rename regex to pattern, as @RyanSquared suggested in #192 2018-03-02 15:31:26 +01:00