vlang / pcre Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Compilation error:
==================
^
/var/folders/2y/7ldjq9qn1ls6b184zfv7040m0000gn/T/v/main.13159573688693451185.tmp.c:1226:31: error: expected identifier or '('
static string struct pcre_str(struct pcre it); // auto
^
/var/folders/2y/7ldjq9qn1ls6b184zfv7040m0000gn/T/v/main.13159573688693451185.tmp.c:1226:31: error: expected ')'
/var/folders/2y/7ldjq9qn1ls6b184zfv7040m0000gn/T/v/main.13159573688693451185.tmp.c:1226:30: note: to match this '('
static string struct pcre_str(struct pcre it); // auto
^
/var/folders/2y/7ldjq9qn1ls6b184zfv7040m0000gn/T/v/main.13159573688693451185.tmp.c:1227:28: error: expected ';' after top level declarator
static string indent_struct pcre_str(struct pcre it, int indent_count); // auto
^
;
...
==================
(Use `v -cg` to print the entire error message)
I have pcre installed via Homebrew:
$ brew info pcre
pcre: stable 8.44 (bottled), HEAD
Perl compatible regular expressions library
https://www.pcre.org/
/usr/local/Cellar/pcre/8.44 (204 files, 5.5MB) *
Poured from bottle on 2020-05-19 at 12:31:13
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pcre.rb
License: BSD-3-Clause
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 168,466 (30 days), 553,389 (90 days), 2,721,188 (365 days)
install-on-request: 6,893 (30 days), 23,707 (90 days), 82,768 (365 days)
build-error: 0 (30 days)
I'm not familiar with C. Is this perhaps a C-compiler issue?
I'm curious to know the reason why the newer PCRE2 library is not used (the older PCRE library "is now at end of life, and is no longer being actively maintained").
OS version: Pop!_os 20.10
error log:
error: cannot initialize builtin type `string`
pub fn new_regex(source string, options int) ?Regex {
err := string{}
studyerr := string{}
erroffset := 0
Fix would be quite easy :)
err := ""
studyerr := ""
The biggest advantage of doing this is that the pcre regex features are then available to all backends, not just C.
Sounds silly as get_all uses get to gather it's results. But this is what we get.
import pcre
// match value between double quotes (don't include quotes)
r := pcre.new_regex('"(.*?)"', 0)!
s := '"hello"'
m := r.match_str(s, 0, 0) or {
println('No match!')
return
}
println(m.get(0)!) // "hello"
println(m.get_all()[0]) // hello
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.