Comments (2)
If anyone is interested, here is the revised version for ini:
import 'package:highlight/src/common_modes.dart';
import 'package:highlight/src/mode.dart';
///
String either(List<String> args) => '(' + args.join('|') + ')';
///
String BARE_KEY = r'([A-Za-z0-9_-]+)(\s*\.\s*[A-Za-z0-9_-]+)*';
///
String QUOTED_KEY_DOUBLE_QUOTE = r'"("|[^"])*"';
///
String QUOTED_KEY_SINGLE_QUOTE = r"'[^']*'";
///
String ANY_KEY = either(
[
BARE_KEY,
QUOTED_KEY_DOUBLE_QUOTE,
QUOTED_KEY_SINGLE_QUOTE,
],
);
///
final ini = Mode(
refs: {
'~contains~2~starts~contains~1~contains~4': Mode(
className: 'number',
relevance: 0,
variants: [
Mode(
begin: '([\\+\\-]+)?[\\d]+_[\\d_]+',
),
Mode(
begin: '\\b\\d+(\\.\\d+)?',
)
],
),
'~contains~2~starts~contains~1~contains~3': Mode(
className: 'string',
contains: [BACKSLASH_ESCAPE],
variants: [
Mode(
begin: "'''",
end: "'''",
relevance: 10,
),
Mode(
begin: '\"\"\"',
end: '\"\"\"',
relevance: 10,
),
Mode(
begin: '\"',
end: '\"',
),
Mode(
begin: "'",
end: "'",
),
],
),
'~contains~2~starts~contains~1~contains~2': Mode(
className: 'variable',
variants: [
Mode(
begin: '\\\$[\\w\\d\"][\\w\\d_]*',
),
Mode(
begin: '\\\$\\{(.*?)}',
),
],
),
'~contains~2~starts~contains~1~contains~1': Mode(
className: 'literal',
begin: '\\bon|off|true|false|yes|no\\b',
),
'~contains~0': Mode(
className: 'comment',
contains: [
PHRASAL_WORDS_MODE,
Mode(
className: 'doctag',
begin: '(?:TODO|FIXME|NOTE|BUG|XXX):',
relevance: 0,
)
],
variants: [
Mode(
begin: ';',
end: '\$',
),
Mode(
begin: '#',
end: '\$',
),
],
),
},
aliases: ['toml'],
case_insensitive: true,
illegal: r'\S',
contains: [
Mode(
ref: '~contains~0',
),
Mode(
className: 'section',
begin: '\\[+',
end: '\\]+',
),
Mode(
begin: ANY_KEY,
className: 'attr',
starts: Mode(
end: '\$',
contains: [
Mode(
ref: '~contains~0',
),
Mode(
begin: '\\[',
end: '\\]',
contains: [
Mode(ref: '~contains~0'),
Mode(
ref: '~contains~2~starts~contains~1~contains~1',
),
Mode(
ref: '~contains~2~starts~contains~1~contains~2',
),
Mode(
ref: '~contains~2~starts~contains~1~contains~3',
),
Mode(
ref: '~contains~2~starts~contains~1~contains~4',
),
Mode(
self: true,
)
],
relevance: 0,
),
Mode(
ref: '~contains~2~starts~contains~1~contains~1',
),
Mode(
ref: '~contains~2~starts~contains~1~contains~2',
),
Mode(
ref: '~contains~2~starts~contains~1~contains~3',
),
Mode(
ref: '~contains~2~starts~contains~1~contains~4',
),
],
),
),
],
);
I did not make a pull request since the file is marked:
// GENERATED CODE - DO NOT MODIFY BY HAND
from highlight.dart.
Just using my app and noticed that the ini format is not working everything else is just looks like this needs implementing
from highlight.dart.
Related Issues (20)
- Migrate example to AndroidX
- flutter_highlight autodetect not working HOT 1
- NNBD migration HOT 4
- There should be an option to specify a background color that overrides both theme and the default color.
- Using highlighting in Orgro
- Muitple language support HOT 1
- How to make a HighlightView widget's text selectable?
- Add GDScript as language
- line by line parsing (simple change) HOT 4
- Number sign (#) breaks java highlighting
- Multiline string literal breaks java highlighting
- Automate porting from JavaScript
- Double quotes (") are not escaped
- Code issue
- Extra padding at the bottom of the code block HOT 1
- Missing highlights
- Maintenance status? HOT 2
- We forked this package and have fixed many bugs HOT 10
- Html Highlights
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 highlight.dart.