Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
af67d087
Commit
af67d087
authored
Jun 23, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor: Add result types for known failure cases
parent
530700a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
14 deletions
+44
-14
cassowary.dart
packages/cassowary/lib/cassowary.dart
+1
-0
result.dart
packages/cassowary/lib/result.dart
+29
-0
solver.dart
packages/cassowary/lib/solver.dart
+14
-14
No files found.
packages/cassowary/lib/cassowary.dart
View file @
af67d087
...
...
@@ -14,3 +14,4 @@ part 'solver.dart';
part
'symbol.dart'
;
part
'row.dart'
;
part
'utils.dart'
;
part
'result.dart'
;
packages/cassowary/lib/result.dart
0 → 100644
View file @
af67d087
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
cassowary
;
class
Result
{
final
bool
error
;
final
String
message
;
const
Result
(
this
.
message
,
this
.
error
);
static
final
Result
success
=
const
Result
(
"Success"
,
false
);
static
final
Result
unimplemented
=
const
Result
(
"Unimplemented"
,
true
);
static
final
Result
duplicateConstraint
=
const
Result
(
"Duplicate Constraint"
,
true
);
static
final
Result
unsatisfiableConstraint
=
const
Result
(
"Unsatisfiable Constraint"
,
true
);
static
final
Result
unknownConstraint
=
const
Result
(
"Unknown Constraint"
,
true
);
static
final
Result
duplicateEditVariable
=
const
Result
(
"Duplicate Edit Variable"
,
true
);
static
final
Result
badRequiredStrength
=
const
Result
(
"Bad Required Strength"
,
true
);
static
final
Result
unknownEditVariable
=
const
Result
(
"Unknown Edit Variable"
,
true
);
static
final
Result
internalSolverError
=
const
Result
(
"Internal Solver Error"
,
true
);
}
packages/cassowary/lib/solver.dart
View file @
af67d087
...
...
@@ -13,32 +13,32 @@ class Solver {
final
Row
_objective
=
new
Row
();
final
Row
_artificial
=
new
Row
();
bool
addConstraint
(
Constraint
c
)
{
return
false
;
Result
addConstraint
(
Constraint
c
)
{
return
Result
.
unimplemented
;
}
bool
removeContraint
(
Constraint
c
)
{
return
false
;
Result
removeContraint
(
Constraint
c
)
{
return
Result
.
unimplemented
;
}
bool
hasConstraint
(
Constraint
c
)
{
return
false
;
Result
hasConstraint
(
Constraint
c
)
{
return
Result
.
unimplemented
;
}
bool
addEditVariable
(
Variable
v
,
double
priority
)
{
return
false
;
Result
addEditVariable
(
Variable
v
,
double
priority
)
{
return
Result
.
unimplemented
;
}
bool
removeEditVariable
(
Variable
v
)
{
return
false
;
Result
removeEditVariable
(
Variable
v
)
{
return
Result
.
unimplemented
;
}
bool
hasEditVariable
(
Variable
v
)
{
return
false
;
Result
hasEditVariable
(
Variable
v
)
{
return
Result
.
unimplemented
;
}
bool
suggestVariable
(
Variable
v
,
double
value
)
{
return
false
;
Result
suggestVariable
(
Variable
v
,
double
value
)
{
return
Result
.
unimplemented
;
}
void
updateVariable
()
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment