Comments (1)
Hopefully it's as easy as fixing the regex filtering for %properties here https://github.com/theos/theos/blob/master/bin/logos.pl#L566: /\G%property\s*(?:\((\s*\w+\s*(?:,\s*(?:\w|\=|:)+\s*)*)\))?\s*((?:\w+\s+\**)+)(\w+)\s*;/gc
, ((?:\w+\s+\**)+)(\w+)
being the main part to change.
It might also be beneficial to support more than just \w+
named properties.
This might be a suitable replacement for that part ([a-zA-Z_$][\w$]*(?:\s*[a-zA-Z_$][\w$]*)*(?:\s*\*+)?)\s*(\b[a-zA-Z_$][\w$]*+)
such that the resulting regex would be /\G%property\s*(?:\((\s*\w+\s*(?:,\s*(?:\w|\=|:)+\s*)*)\))?\s*([a-zA-Z_$][\w$]*(?:\s*[a-zA-Z_$][\w$]*)*(?:\s*\*+)*)\s*(\b[a-zA-Z_$][\w$]*+)\s*;/gc
. It's awkwardly longer because \w
matches [a-zA-Z0-9_]
but you can't start symbols with a number so I used [a-zA-Z_$]
as first character and [\w$]
for the following ($
is a valid character in symbols).
These should match:
%property (retain, getter=string2) NSString *string;
%property NSString *string;
%property NSNumber* number;
%property NSSet * set2;
%property BOOL bool;
%property struct dirent _dir;
%property char **list;
%property char2 **list2;
%property char_3 **list_3;
%property char$4 **list$4;
%property char5$ * *list5$;
While these shouldn't match:
%property 2 broken;
%property 2NSString* string;
%property NSNumber* 2number;
%property 2NSSet* 2set;
To compare, current version vs this version
from logos.
Related Issues (20)
- Nullability specifiers not supported in %subclass methods
- Cannot find module ' ./logo.svg' or its corresponding type declarations. HOT 2
- Logos failes to hook NSBundle.bundleIdentifier on iOS 16 HOT 2
- Mixing `}` with `'` results in a false positive missing closure [Beeper] HOT 1
- Request: dot in class name support for %c HOT 4
- `super` in %subclass is dodgy HOT 1
- Nullability specifiers not supported in %property HOT 3
- Add [super ...] calls
- Logos compilation error if multiline comment has //
- Regression in %hookf HOT 4
- Issue when using %property to add NSMutableArray with specified item type HOT 2
- %property crashes when no parameters set HOT 8
- Line comments are incorrectly handled within block comments HOT 2
- Logos produces bad output without newline after imports HOT 1
- %config(generator=Internal) does not work but using `internal` does HOT 1
- [logos] preprocess could not handle comment outed braces correctly. HOT 2
- [Bug]: space/newline in %init causes issues HOT 1
- iOSOpenDev compiles with logos.pl in Xcode 14.1 RC2 with numerous deprecation warnings HOT 2
- Logos fails to parse code with curly braces inside of character literals
- Logos ignores end of block comment if line contains a `//` before block comment terminator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logos.